Part Number Hot Search : 
N4124 AT93C57 LBN08901 74LS2 B105K 740MR BAS70 TRRPB
Product Description
Full Text Search
 

To Download PCA9665 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 PCA9665
Fm+ parallel bus to I2C-bus controller
Rev. 02 -- 7 December 2006 Product data sheet
1. General description
The PCA9665 serves as an interface between most standard parallel-bus microcontrollers/microprocessors and the serial I2C-bus and allows the parallel bus system to communicate bidirectionally with the I2C-bus. The PCA9665 can operate as a master or a slave and can be a transmitter or receiver. Communication with the I2C-bus is carried out on a Byte or Buffered mode using interrupt or polled handshake. The PCA9665 controls all the I2C-bus specific sequences, protocol, arbitration and timing with no external timing element required. The PCA9665 has the same footprint as the PCA9564 with additional features:
* * * * *
1 MHz transmission speeds Up to 25 mA drive capability on SCL/SDA 68-byte buffer I2C-bus General Call Software reset on the parallel bus
2. Features
I I I I I I I I I I I I Parallel-bus to I2C-bus protocol converter and interface Both master and slave functions Multi-master capability Internal oscillator trimmed to 15 % accuracy reduces external components 1 Mbit/s and up to 25 mA SCL/SDA IOL (Fast-mode Plus (Fm+)) capability I2C-bus General Call capability Software reset on parallel bus 68-byte data buffer Operating supply voltage: 2.3 V to 3.6 V 5 V tolerant I/Os Standard-mode and Fast-mode I2C-bus capable and compatible with SMBus ESD protection exceeds 2000 V HBM per JESD22-A114, 200 V MM per JESD22-A115, and 1000 V CDM per JESD22-C101 I Latch-up testing is done to JEDEC Standard JESD78 which exceeds 100 mA I Packages offered: DIP20, SO20, TSSOP20, HVQFN20
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
3. Applications
I Add I2C-bus port to controllers/processors that do not have one I Add additional I2C-bus ports to controllers/processors that need multiple I2C-bus ports I Converts 8 bits of parallel data to serial data stream to prevent having to run a large number of traces across the entire printed-circuit board
4. Ordering information
Table 1. Ordering information Tamb = -40 C to +85 C Type number PCA9665BS PCA9665D PCA9665N PCA9665PW Topside mark 9665 PCA9665D PCA9665N PCA9665 Package Name HVQFN20 SO20 DIP20 TSSOP20 Description plastic thermal enhanced very thin quad flat package; no leads; 20 terminals; body 5 x 5 x 0.85 mm plastic small outline package; 20 leads; body width 7.5 mm plastic dual in-line package; 20 leads (300 mil) plastic thin shrink small outline package; 20 leads; body width 4.4 mm Version SOT662-1 SOT163-1 SOT146-1 SOT360-1
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
2 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
5. Block diagram
data D7 D6 D5 D4 D3 D2 D1 D0
PCA9665
SDA FILTER BUS BUFFER direct registers A1 SDA CONTROL 68-BYTE BUFFER - AA ENSIO STA STO SI SCL FILTER ST5 ST4 ST3 ST2 ST1 ST0 0 0 0 0 I2CSTA - status register - read only AA ENSIO STA STO SI - - MODE - SD7 SD6 SD5 SD4 SD3 SD2 SD1 SD0 0 1 A0
I2CDAT - data register - read/write
-
-
-
IP2
IP1
IP0
INDPTR - indirect address pointer - write only
0
0
SCL CONTROL
I2CCON - control register - read/write BIT7 BIT6 BIT5 BIT4 BIT3 BIT2 BIT1 BIT0 INDIRECT - indirect register access - read/write
1
1
1
0
ENSIO STA STO SI LB BC6 BC5 BC4 BC3 BC2 BC1 BC0
indirect registers INDPTR 00h I2CCOUNT - byte count - read/write
AD7
AD6 AD5 AD4 AD3 AD2 AD1 I2CADR - own address - read/write L6 L5 L4 L3 L2 L1
GC 01h L0 02h
L7
I2CSCLL - SCL LOW period - read/write
H7
H6
H5
H4
H3
H2
H1
H0 03h BIT0 04h IR0 05h AC0 06h
I2CSCLH - SCL HIGH period - read/write TE BIT6 BIT5 BIT4 BIT3 BIT2 BIT1
I2CTO - TIMEOUT register - read/write IR7 IR6 IR5 IR4 IR3 IR2 IR1
I2CPRESET - software reset register - write only - - - - - - AC1
I2CMODE - I2C-bus mode register - read/write CONTROL BLOCK
CLOCK SELECTOR OSCILLATOR
INTERRUPT CONTROL
POWER-ON RESET
002aab023
CE
WR
RD
INT control signals
RESET
A1
A0
VDD
Fig 1. Block diagram of PCA9665
PCA9665_2 (c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
3 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
6. Pinning information
6.1 Pinning
D0 D1 D2 D3 D4 D5 D6 D7 i.c.
1 2 3 4 5 6 7 8 9
20 VDD 19 SDA 18 SCL 17 RESET 16 INT 15 A1 14 A0 13 CE 12 RD 11 WR
002aab020
D0 D1 D2 D3 D4 D5 D6 D7 i.c.
1 2 3 4 5 6 7 8 9
20 VDD 19 SDA 18 SCL 17 RESET 16 INT 15 A1 14 A0 13 CE 12 RD 11 WR
002aab021
PCA9665D
PCA9665PW
VSS 10
VSS 10
Fig 2. Pin configuration of SO20
Fig 3. Pin configuration of TSSOP20
D0 D1 D2 D3 D4 D5 D6 D7 i.c.
1 2 3 4 5
20 VDD 20 D2 19 D1 18 D0 terminal 1 index area 17 VDD 19 SDA 18 SCL 17 RESET D3 16 INT 1 2 3 4 5 CE 10 6 7 8 9 15 SCL 14 RESET D4 D5 D6 D7 16 SDA 13 INT 12 A1 11 A0
PCA9665N
6 7 8 9 15 A1 14 A0 13 CE 12 RD 11 WR
002aab019
PCA9665BS
i.c.
VSS
WR
VSS 10
RD
002aab022
Transparent top view
Fig 4. Pin configuration of DIP20
Fig 5. Pin configuration of HVQFN20
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
4 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
6.2 Pin description
Table 2. Pin description Type HVQFN20 Description DIP20, SO20, TSSOP20 D0 D1 D2 D3 D4 D5 D6 D7 i.c. VSS WR 1 2 3 4 5 6 7 8 9 10 11 Symbol Pin
18 19 20 1 2 3 4 5 6 7[1] 8
I/O I/O I/O I/O I/O I/O I/O I/O power I
Data bus: Bidirectional 3-state data bus used to transfer commands, data and status between the bus controller and the CPU. D0 is the least significant bit.
internally connected: must be left floating (pulled LOW internally) Supply ground Write strobe: When LOW and CE is also LOW, the content of the data bus is loaded into the addressed register. Data are latched on the rising edge of either WR or CE. Read strobe: When LOW and CE is also LOW, causes the contents of the addressed register to be presented on the data bus. The read cycle begins on the falling edge of RD. Chip Enable: Active LOW input signal. When LOW, data transfers between the CPU and the bus controller are enabled on D0 to D7 as controlled by the WR, RD and A0 to A1 inputs. When HIGH, places the D0 to D7 lines in the 3-state condition. Data are written into the addressed register on rising edge of either CE or WR.
RD
12
9
I
CE
13
10
I
A0 A1 INT RESET SCL SDA VDD
[1]
14 15 16 17 18 19 20
11 12 13 14 15 16 17
I I O I I/O I/O power
Address inputs: Selects the bus controller's internal registers and ports for read/write operations. Interrupt request: Active LOW, open-drain, output. This pin requires a pull-up device. Reset: Active LOW input. A LOW level clears internal registers and resets the I2C-bus state machine. I2C-bus serial clock input/output (open-drain). This pin requires a pull-up device. I2C-bus serial data input/output (open-drain). This pin requires a pull-up device. Power supply: 2.3 V to 3.6 V
HVQFN package die supply ground is connected to both the VSS pin and the exposed center pad. The VSS pin must be connected to supply ground for proper device operation. For enhanced thermal, electrical, and board-level performance, the exposed pad needs to be soldered to the board using a corresponding thermal pad on the board, and for proper heat conduction through the board thermal vias need to be incorporated in the PCB in the thermal pad region.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
5 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
7. Functional description
7.1 General
The PCA9665 acts as an interface device between standard high-speed parallel buses and the serial I2C-bus. On the I2C-bus, it can act either as a master or slave. Bidirectional data transfer between the I2C-bus and the parallel-bus microcontroller is carried out on a byte or buffered basis, using either an interrupt or polled handshake.
7.2 Internal oscillator
The PCA9665 contains an internal 28.5 MHz oscillator which is used for all I2C-bus timing. The oscillator requires up to 550 s to start-up after ENSIO bit is set to `1'.
7.3 Registers
The PCA9665 contains eleven registers which are used to configure the operation of the device as well as to send and receive serial data. There are four registers that can be accessed directly and seven registers that are accessed indirectly by setting a register pointer. The four direct registers are selected by setting pins A0 and A1 to the appropriate logic levels before a read or write operation is executed on the parallel bus. The seven indirect registers require that the INDPTR (indirect register pointer, one of the four direct registers described above) is initially loaded with the address of the register in the indirect address space before a read or write is performed to the INDIRECT data field. For example, in order to write to the indirectly addressed I2CSCLL register, the INDPTR register should be loaded with 02h by performing a write to the direct INDPTR register (A1 = 0, A0 = 0). Then the I2CSCLL register can be programmed by writing to the INDIRECT data field (A1 = 1, A0 = 0) in the direct address space. Register mapping is described in Table 3, Table 4 and Figure 6. Remark: Do not write to any I2C-bus registers while the I2C-bus is busy and the PCA9665 is in master or addressed slave mode.
Table 3. I2CSTA INDPTR I2CDAT I2CCON INDIRECT
[1]
Direct register selection by setting A0 and A1 Register function status indirect register pointer data control indirect data field access A1 0 0 0 1 1 A0 0 0 1 1 0 Read/Write R W R/W R/W R/W Default F8h 00h 00h 00h[1] 00h
Register name
See Section 8.10 "Power-on reset" for more detail.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
6 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Indirect register selection by setting A1 = 1 and A0 = 0 Register function byte count own address SCL LOW period SCL HIGH period time-out parallel software reset I2C-bus mode INDPTR 00h 01h 02h 03h 04h 05h 06h Read/Write R/W R/W R/W R/W R/W W R/W Default 01h E0h 9Dh 86h FFh 00h 00h
Table 4. I2CCOUNT I2CADR I2CSCLL I2CSCLH I2CTO
Register name
I2CPRESET I2CMODE
A1 A0 = 00 read? no A1 A0 = 00 write? no A1 A0 = 10 read/write? no
yes
I2CSTA REGISTER
yes
INDPTR REGISTER
yes
INDPTR = 00h ? no
yes
I2CCOUNT REGISTER
INDPTR = 01h ? A1 A0 = 01 read/write? no yes no I2CDAT REGISTER
yes
I2CADR REGISTER
INDPTR = 02h ? yes no I2CCON REGISTER
yes
I2CSCLL REGISTER
A1 A0 = 11 read/write?
INDPTR = 03h ? no
yes
I2CSCLH REGISTER
INDPTR = 04h ? no
yes
I2CTO REGISTER
INDPTR = 05h ? no
yes
I2CPRESET REGISTER (write only)
INDPTR = 06h ? no RESERVED
yes
I2CMODE REGISTER
002aab459
Fig 6. Register mapping flowchart
PCA9665_2 (c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
7 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
7.3.1 Direct registers
7.3.1.1 The Status register, I2CSTA (A1 = 0, A0 = 0) I2CSTA is an 8-bit read-only register. The two least significant bits are always zero. The six most significant bits contain the status code. There are 30 possible status codes. When I2CSTA contains F8h, it indicates the idle state and therefore no serial interrupt is requested. All other I2CSTA values correspond to defined states. When each of these states is entered, a serial interrupt is requested (SI = 1 and INT asserted LOW). Remark: Data in I2CSTA is valid only when a serial interrupt occurs (SI = 1 and INT asserted LOW). Reading the register when SI = 0 and INT is HIGH may cause wrong values to be read.
Table 5. 7 ST5 Table 6. Bit 7:2 1:0 I2CSTA - Status register (A1 = 0, A0 = 0) bit allocation 6 ST4 5 ST3 4 ST2 3 ST1 2 ST0 1 0 0 0
I2CSTA - Status register (A1 = 0, A0 = 0) bit description Symbol ST[5:0] Description status code corresponding to the different I2C-bus states always at zero
7.3.1.2
The Indirect Pointer register, INDPTR (A1 = 0, A0 = 0)
Table 7. 7 Table 8. Bit 7:3 2:0 INDPTR - Indirect Register Pointer (A1 = 0, A0 = 0) bit allocation 6 5 4 3 2 IP2 1 IP1 0 IP0
INDPTR - Indirect Pointer register (A1 = 0, A0 = 0) bit description Symbol IP2 to IP0 Description reserved; must be written with zeroes address of the indirect register
INDPTR is an 8-bit write-only register. It contains a pointer to a register in the indirect address space (IP[2:0]). The value in the register will determine what indirect register will be accessed when the INDIRECT register is read or written, as defined in Table 4. 7.3.1.3 The I2C-bus Data register, I2CDAT (A1 = 0, A0 = 1) I2CDAT is an 8-bit read/write register. It contains a byte of serial data to be transmitted or a byte which has just been received. In master mode, this includes the slave address that the master wants to send out on the I2C-bus, with the most significant bit of the slave address in the SD7 bit position and the Read/Write bit in the SD0 bit position. The CPU can read from and write to this 8-bit register while the PCA9665 is not in the process of shifting a byte. This occurs when PCA9665 is in a defined state and the serial interrupt flag is set. Data in I2CDAT remains stable as long as SI is set. Whenever the PCA9665 generates an interrupt, the I2CDAT register contains the data byte that was just transferred on the I2C-bus.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
8 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
In Byte mode, the CPU can read or write a single byte at a time. In Buffered mode, the CPU can read or write up to 68 bytes at a time. See Section 8.1 "Configuration modes" for more detail. Remark: The I2CDAT register will capture the serial address as data when addressed via the serial bus. Remark: In Byte mode only, the data register will capture data from the serial bus during 38h (arbitration lost in slave address + R/W or data bytes causing this data in I2CDAT to be changed), so the I2CDAT register will need to be reloaded when the bus becomes free. In Buffered mode, the data is not written in the data register when arbitration is lost, which keeps the buffer intact.
Table 9. 7 SD7 Table 10. Bit 7:0 I2CDAT - Data register (A1 = 0, A0 = 1) bit allocation 6 SD6 5 SD5 4 SD4 3 SD3 2 SD2 1 SD1 0 SD0
I2CDAT - Data register (A1 = 0, A0 = 1) bit description Description Eight bits to be transmitted or just received. A logic 1 in I2CDAT corresponds to a HIGH level on the I2C-bus. A logic 0 corresponds to a LOW level on the bus.
Symbol SD[7:0]
7.3.1.4
The Control register, I2CCON (A1 = 1, A0 = 1) I2CCON is an 8-bit read/write register. Two bits are affected by the bus controller hardware: the SI bit is set when a serial interrupt is requested, and the STO bit is cleared when a STOP condition is present on the I2C-bus. A Write to the I2CCON register via the parallel interface automatically clears the SI bit, which causes the Serial Interrupt line to be de-asserted and the next clock pulse on the SCL line to be generated. Remark: Since none of the registers should be written to via the parallel interface once the Serial Interrupt line has been de-asserted, all the other registers that need to be modified should be written to before the content of the I2CCON register is modified.
Table 11. 7 AA I2CCON - Control register (A1 = 1, A0 = 1) bit allocation 6 ENSIO 5 STA 4 STO 3 SI 2 1 0 MODE
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
9 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
I2CCON - Control register (A1 = 1, A0 = 1) bit description The Assert Acknowledge flag. AA = 1: If the AA flag is set, an acknowledge (LOW level on SDA) will be returned during the acknowledge clock pulse on the SCL line when:
Table 12. Bit 7 AA
Symbol Description
* * *
`Own slave address' has been received (as defined in I2CADR register). A data byte has been received while the bus controller is in the Master Receiver mode. A data byte has been received while the bus controller is in the addressed Slave Receiver mode.
AA = 0: if the AA flag is reset, a not acknowledge (HIGH level on SDA) will be returned during the acknowledge clock pulse on SCL when:
* * *
`Own slave address' has been received (as defined in I2CADR register). A data byte has been received while the PCA9665 is in the Master Receiver mode. A data byte has been received while the PCA9665 is in the addressed Slave Receiver mode.
When the bus controller is in the addressed Slave Transmitter mode, state C8h will be entered after the last data byte is transmitted and an ACK is received from the Master Receiver (see Figure 10 and Figure 14). When SI is cleared, the PCA9665 enters the not addressed Slave Receiver mode, and the SDA line remains at a HIGH level. In state C8h, the AA flag can be set again for future address recognition. When the PCA9665 is in the not addressed slave mode, its own slave address is ignored. Consequently, no acknowledge is returned, and a serial interrupt is not requested. Thus, the bus controller can be temporarily released from the I2C-bus while the bus status is monitored. While the bus controller is released from the bus, START and STOP conditions are detected, and serial data is shifted in. Address recognition can be resumed at any time by setting the AA flag. 6 ENSIO The bus controller enable bit. ENSIO = 0: When ENSIO is `0', the SDA and SCL outputs are in a high-impedance state. SDA and SCL input signals are ignored, the PCA9665 is in the `not addressed' slave state. Internal oscillator is off. ENSIO = 1: When ENSIO is `1', the PCA9665 is enabled. After the ENSIO bit is set to `1', it takes 550 s enable time for the internal oscillator to start up and the serial interface to initialize. The PCA9665 will enter either the master or the slave mode after this time. ENSIO should not be used to temporarily release the PCA9665 from the I2C-bus since, when ENSIO is reset, the I2C-bus status is lost. The AA flag should be used instead (see description of the AA flag above). In the following text, it is assumed that ENSIO = `1' for Normal mode operation. For power-up behavior, please refer to Section 8.10 "Power-on reset".
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
10 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
I2CCON - Control register (A1 = 1, A0 = 1) bit description ...continued The START flag. STA = 1: When the STA bit is set to enter a master mode, the bus controller hardware checks the status of the I2C-bus and generates a START condition if the bus is free. If the bus is not free, then the bus controller waits for a STOP condition (which will free the bus) and generates a START condition after the minimum buffer time (tBUF) has elapsed. If STA is set while the bus controller is already in a master mode and one or more bytes are transmitted or received, the bus controller transmits a repeated START condition. STA may be set at any time. STA may also be set when the bus controller is an addressed slave. A START condition will then be generated after a STOP condition and the minimum buffer time (tBUF) has elapsed. STA = 0: When the STA bit is reset, no START condition or repeated START condition will be generated.
Table 12. Bit 5 STA
Symbol Description
4
STO
The STOP flag. STO = 1: When the STO bit is set while the bus controller is in a master mode, a STOP condition is transmitted on the I2C-bus. When a STOP condition is detected on the bus, the hardware clears the STO flag. If the STA and STO bits are both set, then a STOP condition is transmitted on the I2C-bus, if the PCA9665 is in a master mode. the bus controller then transmits a START condition after the minimum buffer time (tBUF) has elapsed. STO = 0 : When the STO bit is reset, no STOP condition will be generated.
3
SI
The Serial Interrupt flag. SI = 1: When the SI flag is set, and, if the ENSIO bit is also set, a serial interrupt is requested. SI is set by hardware when one of 29 of the 30 possible states of the bus controller states is entered. The only state that does not cause SI to be set is state F8h, which indicates that no relevant state information is available. While SI is set, the LOW period of the serial clock on the SCL line is stretched, and the serial transfer is suspended. A HIGH level on the SCL line is unaffected by the serial interrupt flag. SI is automatically cleared when the I2CCON register is written. The SI bit cannot be set by the user. SI = 0: When the SI flag is reset, no serial interrupt is requested, and there is no stretching of the serial clock on the SCL line.
2:1 0
MODE
Reserved. When I2CCON is read, zeroes are read. Must be written with zeroes. The Mode flag. MODE = 0; Byte mode. See Section 8.1.1 "Byte mode" for more detail. MODE = 1; buffered mode. See Section 8.1.2 "Buffered mode" for more detail.
Remark: ENSIO bit value must be changed only when the I2C-bus is idle. 7.3.1.5 The indirect data field access register, INDIRECT (A1 = 1, A0 = 0) The registers in the indirect address space can be accessed using the INDIRECT data field. Before writing or reading such a register, the INDPTR register should be written with the address of the indirect register that needs to be accessed. Once the INDPTR register contains the appropriate value, reads and writes to the INDIRECT data field will actually read and write the selected indirect register.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
11 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
7.3.2 Indirect registers
7.3.2.1 The Byte Count register, I2CCOUNT (indirect address 00h) The I2CCOUNT register is an 8-bit read/write register. It contains the number of bytes that have been stored in Master/Slave Buffered Receiver mode, and the number of bytes to be sent in Master/Slave Buffered Transmitter mode. Bit 7 is the last byte control bit and applies to the Master/Slave Buffered Receiver mode only. The data in the I2CCOUNT register is relevant only in Buffered mode (MODE = 1) and should not be used (read or written) in Byte mode (MODE = 0).
Table 13. 7 LB Table 14. Bit 7 LB I2CCOUNT - Byte Count register (indirect address 00h) bit allocation 6 BC6 5 BC5 4 BC4 3 BC3 2 BC2 1 BC1 0 BC0
I2CCOUNT - Byte Count register (indirect address 00h) bit description Description Last Byte control bit. Master/Slave Buffered Receiver mode only. LB = 1: PCA9665 does not acknowledge the last received byte. LB = 0: PCA9665 acknowledges the last received byte. A future bus transaction must complete the read sequence by not acknowledging the last byte.
Symbol
6:0
BC[6:0]
Number of bytes to be read or written (up to 68 bytes). If BC[6:0] is equal to 0 or greater than 68 (44h), no bytes will be read or written and an interrupt is immediately generated after writing to the I2CCON register (in Buffered mode only).
7.3.2.2
The Own Address register, I2CADR (indirect address 01h) I2CADR is an 8-bit read/write register. It is not affected by the bus controller hardware. The content of this register is irrelevant when the bus controller is in a master mode. In the slave modes, the seven most significant bits must be loaded with the microcontroller's own slave address and the least significant bit determines if the General Call address will be recognized or not. Remark: AD[7:1] must be different from the General Call address (000 0000) for proper device operation.
Table 15. 7 AD7 Table 16. Bit 7:1 I2CADR - Address register (indirect address 01h) bit allocation 6 AD6 5 AD5 4 AD4 3 AD3 2 AD2 1 AD1 0 GC
I2CADR - Address register (indirect address 01h) bit description Description Own slave address. The most significant bit corresponds to the first bit received from the I2C-bus after a START condition. A logic 1 in I2CADR corresponds to a HIGH level on the I2C-bus, and a logic 0 corresponds to a LOW level on the bus. General Call. GC = 1: General Call address (00h) is recognized. GC = 0: General Call address (00h) is ignored.
Symbol AD[7:1]
0
GC
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
12 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
7.3.2.3
The Clock Rate registers, I2CSCLL and I2CSCLH (indirect addresses 02h and 03h) I2CSCLL and I2CSCLH are 8-bit read/write registers. They define the data rate for the PCA9665 when used as a bus master. The actual frequency is determined by tHIGH (time where SCL is HIGH), tLOW (time where SCL is LOW), tr (rise time), and tf (fall time) values. tHIGH and tLOW are calculated based on the values that are programmed into I2CSCLH and I2CSCLL registers and the internal oscillator frequency. tr and tf are system/application dependent. 1 f SCL = ---------------------------------------------------------------------------------------------T osc ( I 2CSCLL + I 2CSCLH ) + t r + t f with Tosc = internal oscillator period = 35 ns 5 ns Remark: The I2CMODE register needs to be programmed before programming the I2CSCLL and I2CSCLH registers in order to know which I2C-bus mode is selected. See Section 7.3.2.6 "The I2C-bus mode register, I2CMODE (indirect address 06h)" for more detail. Standard-mode is the default selected mode at power-up or after reset.
Table 17. 7 L7 Table 18. Bit 7:0 Table 19. 7 H7 Table 20. Bit 7:0 I2CSCLL - Clock Rate Low register (indirect address 02h) bit allocation 6 L6 5 L5 4 L4 3 L3 2 L2 1 L1 0 L0
I2CSCLL - Clock Rate Low register (indirect address 02h) bit description Symbol L[7:0] Description Eight bits defining the LOW state of SCL.
I2CSCLH - Clock Rate High register (indirect address 03h) bit allocation 6 H6 5 H5 4 H4 3 H3 2 H2 1 H1 0 H0
I2CSCLH - Clock Rate High register (indirect address 03h) bit description Symbol H[7:0] Description Eight bits defining the HIGH state of SCL.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
13 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
7.3.2.4
The Time-out register, I2CTO (indirect address 04h) I2CTO is an 8-bit read/write register. It is used to determine the maximum time that SCL is allowed to be in a LOW logic state before the I2C-bus state machine is reset or the PCA9665 initiates a forced action on the I2C-bus. When the I2C-bus interface is operating, I2CTO is loaded in the time-out counter at every LOW SCL transition.
Table 21. 7 TE Table 22. Bit 7 I2CTO - Time-out register (indirect register 04h) bit allocation 6 TO6 5 TO5 4 TO4 3 TO3 2 TO2 1 TO1 0 TO0
I2CTO - Time-out register (indirect register 04h) bit description Symbol TE Description Time-out enable/disable TE = 1: Time-out function enabled TE = 0: Time-out function disabled
6:0
TO[6:0]
Time-out value. The time-out period = (I2CTO[6:0] + 1) x 143.36 s. The time-out value may vary some, and is an approximate value.
The Time-out register can be used in the following cases:
* When the bus controller, in the master mode, wants to send a START condition and
the SCL line is held LOW by some other device. Then the bus controller waits a time period equivalent to the time-out value for the SCL to be released. In case it is not released, the bus controller concludes that there is a bus error, loads 78h in the I2CSTA register, generates an interrupt signal and releases the SCL and SDA lines. After the microcontroller reads the status register, it needs to send a reset in order to reset the bus controller.
* In the master mode, the time-out feature starts every time the SCL goes LOW. If SCL
stays LOW for a time period equal to or greater than the time-out value, the bus controller concludes there is a bus error and behaves in the manner described above. When the I2C-bus interface is operating, I2CTO is loaded in the time-out counter at every SCL transition. See Section 8.11 "Reset" for more information.
* In case of a forced access to the I2C-bus. (See more details in Section 8.9.3 "Forced
access to the I2C-bus".) 7.3.2.5 The Parallel Software Reset register, I2CPRESET (indirect address 05h) I2CPRESET is an 8-bit write-only register. Programming the I2CPRESET register allows the user to reset the PCA9665 under software control. The software reset is achieved by writing two consecutive bytes to this register. The first byte must be A5h while the second byte must be 5Ah. The writes must be consecutive and the values must match A5h and 5Ah. If this sequence is not followed as described, the reset is aborted.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
14 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
7.3.2.6
The I2C-bus mode register, I2CMODE (indirect address 06h) I2CMODE is an 8-bit read/write register. It contains the control bits that select the correct timing parameters when the device is used in master mode (AC[1:0]). Timing parameters involved with AC[1:0] are tBUF, tHD;STA, tSU;STA, tSU;STO, tHIGH, tLOW.
Table 23. 7 Table 24. Bit 7:2 1:0 I2CMODE - I2C-bus Mode register (indirect address 06h) bit allocation 6 5 4 3 2 1 AC1 0 AC0
I2CMODE - I2C-bus Mode register (indirect address 06h) bit description Symbol AC[1:0] Description Reserved. When I2CMODE is read, zeroes are read. Must be written with zeroes. I2C-bus mode selection to ensure proper timing parameters (see Table 25). AC[1:0] = 00: Standard-mode AC parameters selected. AC[1:0] = 01: Fast-mode AC parameters selected. AC[1:0] = 10: Fast-mode Plus AC parameters selected. AC[1:0] = 11: Turbo mode. In this mode, the user is not limited to a maximum frequency of 1 MHz.
Remark: Change from an I2C-bus mode to a slower one (Fast-mode to Standard-mode, for example) will cause the HIGH and LOW timings of SCL to be violated. It is then required to program the I2CSCLL and I2CSCLH registers with values in accordance with the selected mode.
Table 25. I2C-bus mode selection example[1] I2CSCLH (hexadecimal) 86 14 09 05 I2C-bus frequency (kHz)[2] 99.9 396.8 952.3 AC[1:0] 00 01 10 11 Mode Standard Fast Fast-mode Plus Turbo mode
I2CSCLL (hexadecimal) 9D 2C 11 0E
[1]
I2CSCLL and I2CSCLH values in the table also represents the minimum values that can be used for the corresponding I2C-bus mode. Use of lower values will cause the minimum values to be loaded. Using the formula
[2]
1 f SCL = ---------------------------------------------------------------------------------------------T osc ( I 2CSCLL + I 2CSCLH ) + t r + t f
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
15 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
8. PCA9665 modes
8.1 Configuration modes
Byte mode and Buffered mode are selected using the MODE bit in I2CCON register: MODE = 0: Byte mode MODE = 1: Buffered mode
8.1.1 Byte mode
The Byte mode allows communication on a single command basis. Only one specific command is executed at a time and the Status Register is updated once this single command has been performed. A command can be a START, a STOP, a Byte Write, a Byte Read, and so on.
8.1.2 Buffered mode
The Buffered mode allows several instructions to be executed before an Interrupt is generated and before the I2CSTA register is updated. This allows the microcontroller to request a sequence, up to 68 bytes in a single transmission and lets the PCA9665 perform it without having to access the Status Register and the Control Register each time a single command is performed. The microcontroller can then perform other tasks while the PCA9665 performs the requested sequence. The number of bytes that needs to be sent from the internal buffer (Transmitter mode) or received into the internal buffer (Receiver mode) is defined in the indirectly addressed I2CCOUNT Register (BC[6:0]). Up to 68 bytes can be sent or received.
8.2 Operating modes
The four operating modes are:
* * * *
Master Transmitter Master Receiver Slave Receiver Slave Transmitter
Each mode can be used on a byte basis (Byte mode) or in an up to 68-byte buffer basis (Buffered mode). Data transfers in each mode of operation are shown in Figure 7 through Figure 10. These figures contain the following abbreviations: S -- START condition SLA -- 7-bit slave address R -- Read bit (HIGH level at SDA) W -- Write bit (LOW level at SDA) A -- Acknowledge bit (LOW level at SDA) A -- Not acknowledge bit (HIGH level at SDA) Data -- 8-bit data byte
PCA9665_2 (c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
16 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
P -- STOP condition In Figure 7, Figure 8, Figure 9, Figure 10, Figure 11, Figure 12, Figure 13 and Figure 14, circles are used to indicate when the serial interrupt flag is set. A serial interrupt is not generated when I2CSTA = F8h. This happens on a STOP condition or when an external reset is generated (at power-up, when RESET pin is going LOW or during a software reset on the parallel bus). The numbers in the circles show the status code held in the I2CSTA register. At these points, a service routine must be executed to continue or complete the serial transfer. These service routines are not critical since the serial transfer is suspended until the serial interrupt flag is cleared by software. When a serial interrupt routine is entered, the status code in I2CSTA is used to branch to the appropriate service routine. For each status code, the required software action and details of the following serial transfer are given in Table 27, Table 28, Table 31, Table 32, Table 35, Table 36, Table 40, and Table 41.
8.3 Byte mode
8.3.1 Master Transmitter Byte mode
In the Master Transmitter Byte mode, a number of data bytes are transmitted to a slave receiver (see Figure 7). Before the Master Transmitter Byte mode can be entered, I2CCON must be initialized as shown in Table 26.
Table 26. Bit Symbol Value I2CCON initialization (Byte mode) 7 AA X 6 ENSIO 1 5 STA 0 4 STO 0 3 SI 0 2 X 1 X 0 MODE 0 reserved reserved
ENSIO must be set to logic 1 to enable the PCA9665. If the AA bit is reset, the PCA9665 will not acknowledge its own slave address in the event of another device becoming master of the bus. (In other words, if AA is reset, PCA9665 cannot enter a slave mode.) STA, STO, and SI must be reset. Once ENSIO has been set to 1, it takes about 550 s for the oscillator to start up. The Master Transmitter Byte mode may now be entered by setting the STA bit. The I2C-bus state machine will first test the I2C-bus and generate a START condition as soon as the bus becomes free. When a START condition is transmitted, the serial interrupt flag (SI) is set, the Interrupt line (INT) goes LOW and the status code in the status register (I2CSTA) will be 08h. This status code must be used to vector to an interrupt service routine that loads I2CDAT with the slave address and the data direction bit (SLA+W). A write to I2CCON resets the SI bit, clears the Interrupt (INT goes HIGH) and allows the serial transfer to continue. When the slave address with the direction bit have been transmitted, the Serial Interrupt flag (SI) is set again, the Interrupt line (INT) goes LOW again and I2CSTA is loaded with the following possible codes:
* 18h if an acknowledgment bit (ACK) has been received * 20h if an no acknowledgment bit (NACK) has been received * 38h if the PCA9665 lost the arbitration
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
17 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
* B0h if the PCA9665 lost the arbitration and is addressed as a slave transmitter (slave
mode enabled with AA = 1)
* 68h if the PCA9665 lost the arbitration and is addressed as a slave receiver (slave
mode enabled with AA = 1)
* D8h if the PCA9665 lost the arbitration and is addressed as a slave receiver during a
General Call sequence (slave mode enabled with AA = 1 and General Call address enabled with GC = 1 in I2CADR register) The appropriate action to be taken for each of these status codes is detailed in Table 27. ENSIO is not affected by the serial transfer and is not referred to in Table 27. After a repeated START condition (state 10h), the PCA9665 may switch to the Master Receiver mode by loading I2CDAT with SLA+R. Remark: A master should not transmit its own slave address.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
18 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
MT
successful transmission to a Slave Receiver
S
SLA
W
A
DATA
A
P
08h
18h
28h
(2)
F8h
next transfer started with a repeated START condition
S
SLA
W
10h Not Acknowledge received after the slave address
A
P
R
20h Not Acknowledge received after a data byte
F8h to Master Receiver mode entry = MR(4)
A
P
30h
(3)
F8h
arbitration lost in slave address or data byte
A or A
other MST continues
A or A
other MST continues
38h
38h
arbitration lost and addressed as slave
A
other MST continues
B0h from master to slave 68h from slave to master D8h
to corresponding states in Slave Transmitter mode to corresponding states in Slave Receiver mode to corresponding states in Slave Receiver mode (General Call)
DATA
A
any number of data bytes and their associated Acknowledge bits This number (contained in I2CSTA) corresponds to a defined state of the I2C-bus.(1)
n
002aab024
(1) See Table 27 (2) Defined state when a single byte is sent and an ACK is received. (3) Defined state when a single byte is sent and a NACK is received. (4) Master Receiver Byte mode is entered when MODE = 0. Master Receiver Buffered mode is entered when MODE = 1.
Fig 7. Format and states in the Master Transmitter Byte mode (MODE = 0)
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
19 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Table 27.
Master Transmitter Byte mode (MODE = 0) Application software response To/from I2CDAT Load SLA+W Load SLA+W or Load SLA+R To I2CCON STA STO SI X X X X X X 0 0 0 AA MODE X X X 0 0 0 SLA+W will be transmitted; ACK/NACK will be received SLA+W will be transmitted; ACK/NACK will be received SLA+R will be transmitted; PCA9665 will be switched to Master Receiver Byte mode Next action taken by the PCA9665
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 08h 10h A START condition has been transmitted A repeated START condition has been transmitted
18h
SLA+W has been Load data byte or 0 transmitted; ACK has been received no I2CDAT action 1 or no I2CDAT action 0 or no I2CDAT action 1
0 0 1 1
0 0 0 0
X X X X
0 0 0 0
Data byte will be transmitted; ACK/NACK will be received Repeated START will be transmitted; STOP condition will be transmitted; STO flag will be reset STOP condition followed by a START condition will be transmitted; STO flag will be reset Data byte will be transmitted; ACK/NACK will be received Repeated START will be transmitted; STOP condition will be transmitted; STO flag will be reset STOP condition followed by a START condition will be transmitted; STO flag will be reset Data byte will be transmitted; ACK/NACK will be received Repeated START will be transmitted; STOP condition will be transmitted; STO flag will be reset STOP condition followed by a START condition will be transmitted; STO flag will be reset
20h
SLA+W has been transmitted; NACK has been received
Load data byte or 0 no I2CDAT action 1 or no I2CDAT action 0 or no I2CDAT action 1
0 0 1 1
0 0 0 0
X X X X
0 0 0 0
28h
Data byte in I2CDAT Load data byte or 0 has been transmitted; ACK has been no I2CDAT action 1 received or no I2CDAT action 0 or no I2CDAT action 1
0 0 1 1
0 0 0 0
X X X X
0 0 0 0
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
20 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Table 27.
Master Transmitter Byte mode (MODE = 0) ...continued Application software response To/from I2CDAT To I2CCON STA STO SI 0 0 1 1 0 0 0 0 AA MODE X X X X 0 0 0 0 Data byte will be transmitted; ACK/NACK will be received Repeated START will be transmitted; STOP condition will be transmitted; STO flag will be reset STOP condition followed by a START condition will be transmitted; STO flag will be reset I2C-bus will be released; PCA9665 will enter Slave mode. 0 1 0 0 0 0 1 X 0 0 I2C-bus will be released; PCA9665 will enter the Slave mode. A START condition will be transmitted when the bus becomes free Next action taken by the PCA9665
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 30h
Data byte in I2CDAT Load data byte or 0 has been transmitted; NACK has been no I2CDAT action 1 received or no I2CDAT action 0 or no I2CDAT action 1
38h
Arbitration lost in No I2CDAT SLA+W or Data bytes action or No I2CDAT action or No I2CDAT action
0
0
0
0
0
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
21 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
8.3.2 Master Receiver Byte mode
In the Master Receiver Byte mode, a number of data bytes are received from a slave transmitter one byte at a time (see Figure 8). The transfer is initialized as in the Master Transmitter Byte mode. The Master Receiver Byte mode may now be entered by setting the STA bit. The I2C-bus state machine will first test the I2C-bus and generate a START condition as soon as the bus becomes free. When a START condition is transmitted, the Serial Interrupt flag (SI) is set, the Interrupt line (INT) goes LOW and the status code in the status register (I2CSTA) will be 08h. This status code must be used to vector to an interrupt service routine that loads I2CDAT with the slave address and the data direction bit (SLA+R). A write to I2CCON resets the SI bit, clears the Interrupt (INT goes HIGH) and allows the serial transfer to continue. When the slave address and the data direction bit have been transmitted, the serial interrupt flag (SI) is set again, the Interrupt line (INT) goes LOW again and I2CSTA is loaded with the following possible codes:
* 40h if an acknowledgment bit (ACK) has been received for the slave address with
direction bit
* 48h if a no acknowledgment bit (NACK) has been received for the slave address with
direction bit
* 38h if the PCA9665 lost the arbitration * B0h if the PCA9665 lost the arbitration and is addressed as a slave transmitter (slave
mode enabled with AA = 1)
* 68h if the PCA9665 lost the arbitration and is addressed as a slave receiver (slave
mode enabled with AA = 1)
* D8h if the PCA9665 lost the arbitration and is addressed as a slave receiver during a
General Call sequence (slave mode enabled with AA = 1 and General Call address enabled with GC = 1 in I2CADR register). The appropriate action to be taken for each of these status codes is detailed in Table 28. ENSIO is not affected by the serial transfer and is not referred to in Table 28. After a repeated START condition (state 10h), the PCA9665 may switch to the Master Transmitter mode by loading I2CDAT with SLA+W. Remark: A master should not transmit its own slave address.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
22 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
MR
successful reception from a Slave Transmitter
S
SLA
R
A
DATA
A
DATA
A
P
08h
40h
50h
(2)
58h
(3)
F8h
next transfer started with a repeated START condition
S
SLA
R
10h Not Acknowledge received after the slave address
A
P
W
48h
F8h to Master Transmitter mode entry = MT(4)
arbitration lost in slave address or Acknowledge bit
A or A
other MST continues
A
other MST continues
38h
38h
arbitration lost and addressed as slave
A
other MST continues
B0h from master to slave 68h D8h from slave to master any number of data bytes and their associated Acknowledge bits
to corresponding states in Slave Transmitter mode to corresponding states in Slave Receiver mode to corresponding states in Slave Receiver mode (General Call)
DATA
A
n
This number (contained in I2CSTA) corresponds to a defined state of the I2C-bus.(1)
002aab025
(1) See Table 28. (2) Defined state when a single byte is received and an ACK is sent (AA = 1). (3) Defined state when a single byte is received and a NACK is sent (AA = 0). (4) Master Transmitter Byte mode is entered when MODE = 0. Master Transmitter Buffered mode is entered when MODE = 1.
Fig 8. Format and states in the Master Receiver Byte mode (MODE = 0)
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
23 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Table 28.
Master Receiver Byte mode (MODE = 0) Application software response To/from I2CDAT Load SLA+R To I2CCON STA STO SI X X 0 AA MODE X 0 SLA+R will be transmitted; ACK/NACK bit will be received Load SLA+R or Load SLA+W X X X X 0 0 X X 0 0 SLA+R will be transmitted; ACK/NACK bit will be received SLA+W will be transmitted; PCA9665 will be switched to Master Transmitter Byte mode Next action taken by the PCA9665
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 08h A START condition has been transmitted A repeated START condition has been transmitted
10h
38h
Arbitration lost in NACK bit
No I2CDAT action or no I2CDAT action
0 1
0 0
0 0
X X
0 0
I2C-bus will be released; PCA9665 will enter a slave mode A START condition will be transmitted when the bus becomes free Data byte will be received; NACK bit will be returned Data byte will be received; ACK bit will be returned Repeated START condition will be transmitted STOP condition will be transmitted; STO flag will be reset STOP condition followed by a START condition will be transmitted; STO flag will be reset Data byte will be received; NACK bit will be returned Data byte will be received; ACK bit will be returned Repeated START condition will be transmitted STOP condition will be transmitted; STO flag will be reset STOP condition followed by a START condition will be transmitted; STO flag will be reset
40h
SLA+R has been transmitted; ACK has been received
No I2CDAT action or no I2CDAT action No I2CDAT action or no I2CDAT action or no I2CDAT action
0 0 1 0 1
0 0 0 1 1
0 0 0 0 0
0 1 X X X
0 0 0 0 0
48h
SLA+R has been transmitted; NACK has been received
50h
Data byte has been received; ACK has been returned
Read data byte or read data byte
0 0 1 0 1
0 0 0 1 1
0 0 0 0 0
0 1 X X X
0 0 0 0 0
58h
Data byte has been Read data byte or received; NACK has been returned read data byte or read data byte
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
24 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
8.3.3 Slave Receiver Byte mode
In the Slave Receiver Byte mode, a number of data bytes are received from a master transmitter one byte at a time (see Figure 9). To initiate the Slave Receiver mode, I2CADR and I2CCON must be loaded as shown in Table 29 and Table 30.
Table 29. Bit Symbol Value I2CADR initialization 7 AD7 6 AD6 5 AD5 4 AD4 own slave address 3 AD3 2 AD2 1 AD1 0 GC X
The upper 7 bits are the I2C-bus address to which PCA9665 will respond when addressed by a master. GC is the control bit that allows the PCA9665 to respond or not to the General Call address (00h). When programmed to logic 1, the PCA9665 will acknowledge the General Call address. When programmed to logic 0, the PCA9665 will not acknowledge the General Call address.
Table 30. Bit Symbol Value I2CCON initialization 7 AA 1 6 ENSIO 1 5 STA 0 4 STO 0 3 SI 0 2 X 1 X 0 MODE 0
ENSIO must be set to logic 1 to enable the I2C-bus interface. The AA bit must be set to enable PCA9665 to acknowledge its own slave address, STA, STO, and SI must be reset. When I2CADR and I2CCON have been initialized, the PCA9665 waits until it is addressed by its own slave address followed by the data direction bit which must be `0' (W) to operate in the Slave Receiver mode. After its own slave address and the W bit have been received, the Serial Interrupt flag (SI) is set, the Interrupt line (INT) goes LOW, and I2CSTA is loaded with 60h. This status code is used to vector to an interrupt service routine, and the appropriate action to be taken is detailed in Table 31. The Slave Receiver Buffered mode may also be entered when:
* The arbitration is lost while the PCA9665 is in the master mode. See status 68h and
D8h.
* The General Call Address (00h) has been received (General Call address enabled
with GC = 1). See status D0h. If the AA bit is reset during a transfer, the PCA9665 will return a not acknowledge (logic 1) on SDA after the next received data byte. While AA is reset, the I2C-bus state machine does not respond to its own slave address. However, the I2C-bus is still monitored and address recognition may be resumed at any time by setting AA. This means that the AA bit may be used to temporarily isolate PCA9665 from the I2C-bus.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
25 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
reception of own slave address and one or more data bytes; all are Acknowledged. last data byte received is Not Acknowledged
S
SLA
W
A 60h
DATA
A 80h
(2)
DATA
A 80h
(2)
P or S A0h P or S F8h on STOP
A 88h
(3)
arbitration lost as MST and addressed as slave
A 68h P or S F8h on STOP
reception of the General Call address and one or more data bytes
S
GENERAL CALL = 00h
W
A D0h
DATA
A E0h
(2)
DATA
A E0h
(2)
P or S A0h P or S F8h on STOP
last data byte received is Not Acknowledged arbitration lost as MST and addressed as slave by General Call from master to slave P or S from slave to master any number of data bytes and their associated Acknowledge bits This number (contained in I2CSTA) corresponds to a defined state of the I2C-bus.(1) F8h on STOP A D8h
A E8h
(3)
DATA
A
n
002aab026
(1) See Table 31. (2) Defined state when a single byte is received and an ACK is sent (AA = 1). (3) Defined state when a single byte is received and a NACK is sent (AA = 0).
Fig 9. Format and states in the Slave Receiver Byte mode (MODE = 0)
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
26 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Table 31.
Slave Receiver Byte mode (MODE = 0) Application software response To/from I2CDAT To I2CCON STA STO SI No I2CDAT action X or no I2CDAT action X X X X X 0 0 0 0 AA 0 1 0 1 MODE 0 0 0 0 Data byte will be received and NACK will be returned Data byte will be received and ACK will be returned Data byte will be received and NACK will be returned Data byte will be received and ACK will be returned Next action taken by the PCA9665
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 60h Own SLA+W has been received; ACK has been returned Arbitration lost in SLA+R/W as master; Own SLA+W has been received, ACK has been returned General Call address (00h) has been received; ACK has been returned.
68h
No I2CDAT action X or no I2CDAT action X
D0h
No I2CDAT action X or no I2CDAT action X
X X X X
0 0 0 0
0 1 0 1
0 0 0 0
Data byte will be received and NACK will be returned. Data byte will be received and ACK will be returned. Data byte will be received and NACK will be returned. Data byte will be received and ACK will be returned.
D8h
No I2CDAT action X Arbitration lost in or SLA = R/W as master; General Call no I2CDAT action X address has been received; ACK bit has been returned. Read data byte or X Previously addressed with own slave address; DATA read data byte X has been received; ACK has been returned Read data byte or 0 Previously addressed with own slave address; DATA byte has been read data byte or 0 received; NACK has been returned read data byte or 1
80h
X X
0 0
0 1
0 0
Data byte will be received and NACK will be returned Data byte will be received and ACK will be returned
88h
X
0
0
0
Switched to not addressed slave mode; no recognition of own SLA or General Call address Switched to not addressed slave mode; Own slave address will be recognized; General Call address will be recognized if GC = 1. Switched to not addressed slave mode; no recognition of own slave address or General Call address. A START condition will be transmitted when the bus becomes free Switched to not addressed slave mode; Own slave address will be recognized; General Call will be recognized if GC = 1. A START condition will be transmitted when the bus becomes free.
X
0
1
0
X
0
0
0
read data byte
1
X
0
1
0
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
27 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Table 31.
Slave Receiver Byte mode (MODE = 0) ...continued Application software response To/from I2CDAT To I2CCON STA STO SI Read data byte or X read data byte X X X 0 0 AA 0 1 MODE 0 0 Data byte will be received and NACK will be returned. Data byte will be received and ACK will be returned. Next action taken by the PCA9665
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 E0h Previously addressed with General Call; Data has been received; ACK has been returned Previously addressed with General Call; Data has been received; NACK has been returned
E8h
Read data byte or 0
X
0
0
0
Switched to not addressed slave mode; no recognition of own slave address or General Call address. Switched to not addressed slave mode; own slave address will be recognized; General Call address will be recognized if GC = 1. Switched to not addressed slave mode; no recognition of own slave address or General Call address. A START condition will be transmitted when the bus becomes free. Switched to not addressed slave mode; own slave address will be recognized; General Call address will be recognized if GC = 1. A START condition will be transmitted when the bus becomes free. Switched to not addressed slave mode; no recognition of own slave address or General Call address. Switched to not addressed slave mode; Own slave address will be recognized; General Call will be recognized if GC = 1. Switched to not addressed slave mode; no recognition of own slave address or General Call. A START condition will be transmitted when the bus becomes free Switched to not addressed slave mode; Own slave address will be recognized; General Call will be recognized if GC = 1. A START condition will be transmitted when the bus becomes free.
read data byte or
0
X
0
1
0
read data byte or
1
0
0
0
0
read data byte
1
0
0
1
0
A0h
A STOP condition or repeated START condition has been received while still addressed as Slave Receiver
No I2CDAT action 0 or No I2CDAT action 0 or
X
0
0
0
X
0
1
0
No I2CDAT action 1 or
X
0
0
0
No I2CDAT action 1
X
0
1
0
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
28 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
8.3.4 Slave Transmitter Byte mode
In the Slave Transmitter Byte mode, a number of data bytes are transmitted to a master receiver one byte at a time (see Figure 10). Data transfer is initialized as in the Slave Receiver Byte mode. When I2CADR and I2CCON have been initialized, the PCA9665 waits until it is addressed by its own slave address followed by the data direction bit which must be `1' (R) for the PCA9665 to operate in the Slave Transmitter mode. After its own slave address and the R bit have been received, the Serial Interrupt flag (SI) is set, the Interrupt line (INT) goes LOW and I2CSTA is loaded with A8h. This status code is used to vector to an interrupt service routine, and the appropriate action to be taken is detailed in Table 32. The Slave Transmitter Byte mode may also be entered if arbitration is lost while the PCA9665 is in the master mode. See state B0h and appropriate actions in Table 32. If the AA bit is reset during a transfer, the PCA9665 will transmit the last byte of the transfer and enter state C8h. The PCA9665 is switched to the not addressed slave mode and will ignore the master receiver if it continues the transfer. Thus the master receiver receives all `1's as serial data. While AA is reset, the PCA9665 does not respond to its own slave address. However, the I2C-bus is still monitored, and address recognition may be resumed at any time by setting AA. This means that the AA bit may be used to temporarily isolate SIO from the I2C-bus.
reception of own slave address and transmission of one or more data bytes
S
SLA
R
A
DATA
A
DATA
A
P or S
A8h
B8h
(2)
C0h
(3)
F8h on STOP
arbitration lost as MST and addressed as slave
A
B0h from master to slave last data byte transmitted; switched to Not Addressed slave (AA bit in I2CCON = 0)
A
ALL '1's
P or S
from slave to master C8h DATA A any number of data bytes and their associated Acknowledge bits This number (contained in I2CSTA) corresponds to a defined state of the I2C-bus.(1)
(4)
F8h on STOP
002aab027
n
(1) See Table 31. (2) Defined state when a single byte is transmitted and an ACK is received. (3) Defined state when a single byte is transmitted and a NACK is received. (4) Defined state when a single byte is transmitted and the PCA9665 goes to the non-addressed mode (AA = 0) and an ACK is received.
Fig 10. Format and states in the Slave Transmitter Byte mode (MODE = 0)
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
29 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Table 32.
Slave Transmitter Byte mode (MODE = 0) Application software response To/from I2CDAT To I2CCON STA STO SI Load data byte or load data byte X X X X X X X X 0 0 0 0 AA MODE 0 1 0 1 0 0 0 0 Last data byte will be transmitted and ACK/NACK bit will be received Data byte will be transmitted; ACK/NACK will be received Last data byte will be transmitted and ACK/NACK bit will be received Data byte will be transmitted; ACK bit will be received Next action taken by PCA9665
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 A8h Own SLA+R has been received; ACK has been returned
B0h
Load data byte Arbitration lost in or SLA+R/W as master; Own SLA+R load data byte has been received, ACK has been returned Data byte in I2CDAT Load data byte or has been transmitted; ACK load data byte has been received Data byte in I2CDAT No I2CDAT action or has been transmitted; NACK has been received no I2CDAT action or no I2CDAT action or
B8h
X X 0
X X X
0 0 0
0 1 0
0 0 0
Last data byte will be transmitted and ACK/NACK bit will be received Data byte will be transmitted; ACK/NACK bit will be received Switched to not addressed slave mode; no recognition of own slave address. General Call address recognized if GC = 1. Switched to slave mode; Own slave address will be recognized. General Call address recognized if GC = 1. Switched to not addressed slave mode; no recognition of own slave address. General Call address recognized if GC = 1. A START condition will be transmitted when the bus becomes free Switched to slave mode; Own slave address will be recognized. General Call address recognized if GC = 1. A START condition will be transmitted when the bus becomes free. Switched to not addressed slave mode; no recognition of own slave address. General Call address recognized if GC = 1. Switched to slave mode; Own slave address will be recognized. General Call address recognized if GC = 1. Switched to not addressed slave mode; no recognition of own slave address. General Call address recognized if GC = 1. A START condition will be transmitted when the bus becomes free Switched to slave mode; Own slave address will be recognized. General Call address recognized if GC = 1. A START condition will be transmitted when the bus becomes free.
(c) NXP B.V. 2006. All rights reserved.
C0h
0
X
0
1
0
1
X
0
0
0
no I2CDAT action
1
X
0
1
0
C8h
No I2CDAT Last data byte in action or I2CDAT has been transmitted (AA = 0); ACK has been received no I2CDAT action or no I2CDAT action or
0
X
0
0
0
0
X
0
1
0
1
X
0
0
0
no I2CDAT action
1
X
0
1
0
PCA9665_2
Product data sheet
Rev. 02 -- 7 December 2006
30 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
8.4 Buffered mode
8.4.1 Master Transmitter Buffered mode
In the Master Transmitter Buffered mode, a number of data bytes are transmitted to a slave receiver several bytes at a time (see Figure 11). Before the Master Transmitter Buffered mode can be entered, I2CCON must be initialized as shown in Table 33.
Table 33. Bit Symbol Value Table 34. Bit Symbol Value I2CCON initialization (Buffered mode) 7 AA X 6 ENSIO 1 5 STA 0 4 STO 0 3 SI 0 2 X 1 X 0 MODE 1 reserved reserved
I2CCOUNT programming 7 LB X 6 BC6 5 BC5 4 BC4 3 BC3 2 BC2 1 BC1 0 BC0
number of bytes received in a single sequence (1 byte to 68 bytes)
ENSIO must be set to logic 1 to enable the PCA9665. If the AA bit is reset, the PCA9665 will not acknowledge its own slave address in the event of another device becoming master of the bus (in other words, if AA is reset, the PCA9665 cannot enter a slave mode). STA, STO, and SI must be reset. Once ENSIO has been set to logic 1, it takes about 550 s for the oscillator to start up. The Master Transmitter Buffered mode may now be entered by setting the STA bit. The I2C-bus state machine will first test the I2C-bus and generate a START condition as soon as the bus becomes free. When a START condition is transmitted, the Serial Interrupt flag (SI) is set, the Interrupt line (INT) goes LOW and the status code in the status register (I2CSTA) will be 08h. This status code must be used to vector to an interrupt service routine that loads I2CDAT with the slave address and the data direction bit (SLA+W) followed by the number of data bytes to be sent. The byte count register (I2CCOUNT) has been previously programmed with the number of bytes that need to be sent in a single sequence (BC[6:0]) as shown in Table 34. LB bit is only used for the Receiver Buffered modes and can be programmed to either logic 0 or logic 1. The total number of bytes loaded in I2CDAT (slave address with direction bit plus data bytes) must be equal to the value programmed in I2CCOUNT. A write to I2CCON resets the SI bit, clears the Interrupt (INT goes HIGH) and allows the serial transfer to continue. When the slave address with the direction bit and part of or all the following bytes have been transmitted, the Serial Interrupt flag (SI) is set again, the Interrupt line (INT) goes LOW again and I2CSTA is loaded with the following possible codes:
* 18h if an acknowledgment bit (ACK) has been received for the slave address with
direction bit (happens only if I2CCOUNT = 1; no data bytes have been sent).
* 20h if a no acknowledgment bit (NACK) has been received for the slave address with
direction bit (no data bytes have been sent).
* 28h if the slave address with direction bit and all the data bytes have been transmitted
and an acknowledgement bit has been received for each of them (number of bytes sent is equal to value in I2CCOUNT).
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
31 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
* 30h if the slave address with direction bit has been successfully sent and no
acknowledgement (NACK) has been received while transmitting the data bytes (number of total bytes sent is lower than or equal to value in I2CCOUNT).
* 38h if the PCA9665 lost the arbitration when sending the slave address with the
direction bit or when sending data bytes.
* B0h if the PCA9665 lost the arbitration and is addressed as a slave transmitter (slave
mode enabled with AA = 1).
* 68h if the PCA9665 lost the arbitration and is addressed as a slave receiver (slave
mode enabled with AA = 1).
* D8h if the PCA9665 lost the arbitration and is addressed as a slave receiver during a
General Call sequence (slave mode enabled with AA = 1 and General Call address enabled with GC = 1 in I2CADR register). The appropriate action to be taken for each of these status codes is detailed in Table 35. ENSIO is not affected by the serial transfer and is not referred to in Table 35. After a repeated START condition (state 10h), the PCA9665 may switch to the Master Receiver mode by loading I2CDAT with SLA+R). Remark: A master should not transmit its own slave address.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
32 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
MT
successful transmission to a Slave Receiver
S
SLA
W
A
DATA
A
P
08h
18h
(2)
28h
(3)
F8h
next transfer started with a repeated START condition
S
SLA
W
10h Not Acknowledge received after the slave address
A
P
R
20h Not Acknowledge received after a data byte
F8h to MST/REC mode entry = MR(5)
A
P
30h
(4)
F8h
arbitration lost in slave address or data byte
A or A
other MST continues
A or A
other MST continues
38h
38h
arbitration lost and addressed as slave
A
other MST continues
B0h from master to slave 68h from slave to master D8h
to corresponding states in Slave Transmitter mode to corresponding states in Slave Receiver mode to corresponding states in Slave Receiver mode (General Call)
DATA
A
any number of data bytes and their associated Acknowledge bits This number (contained in I2CSTA) corresponds to a defined state of the I2C-bus.(1)
n
002aab659
(1) See Table 35 (2) Serial interrupt that occurs when BC[6:0] = 01. No serial interrupt if BC[6:0] > 01. (3) Defined state when the number of bytes sent is equal to the value in I2CCOUNT register and an ACK has been received for all the bytes sent. (4) Defined state when a NACK received while number of bytes sent is lower than or equal to value in I2CCOUNT register. (5) Master Receiver Byte mode is entered when MODE = 0. Master Receiver Buffered mode is entered when MODE = 1. Remark: The master should never transmit its own slave address.
Fig 11. Format and states in the Master Transmitter Buffered mode (MODE = 1)
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
33 of 91
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx
Product data sheet Rev. 02 -- 7 December 2006
(c) NXP B.V. 2006. All rights reserved. PCA9665_2
NXP Semiconductors
Table 35.
Master Transmitter Buffered mode (MODE = 1) Application software response To/from I2CDAT To I2CCOUNT LB BC[6:0] Load SLA+W and X the data bytes To I2CCON STA STO SI X 0 AA MODE X 1 SLA+W will be transmitted. If ACK bit received, data bytes will be transmitted until all of them have been sent and an ACK has been received for each of them or until a NACK bit is received. SLA+W will be transmitted. If ACK bit received, data bytes will be transmitted until all of them have been sent and an ACK has been received for each of them or until a NACK bit is received. SLA+R will be transmitted. PCA9665 will be switched to Master Receiver Buffered mode. 0 0 X 1 Up to BC[6:0] data bytes will be transmitted (until all of them have been sent and an ACK has been received for each of them or until a NACK bit is received). Repeated START will be transmitted. STOP condition will be transmitted. STO flag will be reset. X 1 1 0 X 1 STOP condition followed by a START condition will be transmitted. STO flag will be reset. Up to BC[6:0] data bytes will be transmitted (until all of them have been sent and an ACK has been received for each of them or until a NACK bit is received). Repeated START will be transmitted. STOP condition will be transmitted;. STO flag will be reset. X 1 1 0 X 1 STOP condition followed by a START condition will be transmitted. STO flag will be reset. Next action taken by the PCA9665
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 08h A START condition has been transmitted A repeated START condition has been transmitted
Total number of bytes X to be transmitted (= SLA+W + number of data bytes) Total number of bytes X to be transmitted (= SLA+W + number of data bytes) Total number of bytes X to be received Total number of data bytes to be transmitted X X 0
10h
Load SLA+W and X the data bytes or
X
0
X
1
Load SLA+R
X
X
0
X
1
18h
SLA+W has been transmitted; ACK has been received
Load the data bytes or
X
no I2CDAT action X or no I2CDAT action X or no I2CDAT action X
1 0
0 1
0 0
X X
1 1
Fm+ parallel bus to I2C-bus controller
20h
SLA+W has been transmitted; NACK has been received
Load the data bytes or
0
Total number of data bytes to be transmitted X X
0
0
0
X
1
no I2CDAT action 1 or no I2CDAT action 0 or no I2CDAT action 1
1 0
0 1
0 0
X X
1 1
PCA9665
34 of 91
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx
Table 35. Master Transmitter Buffered mode (MODE = 1) ...continued Application software response To/from I2CDAT Load the data bytes or To I2CCOUNT LB BC[6:0] X Total number of data bytes to be transmitted X X X To I2CCON STA STO SI 0 0 0 AA MODE X 1 Up to BC[6:0] data bytes will be transmitted (until all of them have been sent and an ACK has been received for each of them or until a NACK bit is received). Repeated START will be transmitted. STOP condition will be transmitted. STO flag will be reset. 1 1 0 X 1 TOP condition followed by a START condition will be transmitted. STO flag will be reset. 30h Up to BC[6:0] bytes Load the data in I2CDAT have bytes or been transmitted; X Total number of data bytes to be transmitted X X X 0 0 0 X 1 Up to BC[6:0] data bytes will be transmitted (until all of them have been sent and an ACK has been received for each of them or until a NACK bit is received). Repeated START will be transmitted. STOP condition will be transmitted. STO flag will be reset. 1 1 0 X 1 STOP condition followed by a START condition will be transmitted. STO flag will be reset. 38h Arbitration lost in SLA+W or Data bytes No I2CDAT action or No I2CDAT action or No I2CDAT action X X X X X X 0 0 1 0 0 0 0 0 0 0 1 X 1 1 1 I2C-bus will be released; PCA9665 will enter the not addressed slave mode. I2C-bus will be released; PCA9665 will enter the slave mode. A START condition will be transmitted when the bus becomes free. Next action taken by the PCA9665
Product data sheet Rev. 02 -- 7 December 2006
(c) NXP B.V. 2006. All rights reserved. PCA9665_2
NXP Semiconductors
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 28h BC[6:0] bytes in I2CDAT have been transmitted; ACK has been received for all of them
no I2CDAT action X or no I2CDAT action X or no I2CDAT action X
1 0
0 1
0 0
X X
1 1
NACK has been received for the last no I2CDAT action X byte or no I2CDAT action X or no I2CDAT action X
1 0
0 1
0 0
X X
1 1
Fm+ parallel bus to I2C-bus controller
PCA9665
35 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
8.4.2 Master Receiver Buffered mode
In the Master Receiver Buffered mode, a number of data bytes are received from a slave transmitter several bytes at a time (see Figure 12). The transfer is initialized as in the Master Transmitter Byte mode. The Master Receiver Buffered mode may now be entered by setting the STA bit. The I2C-bus state machine will first test the I2C-bus and generate a START condition as soon as the bus becomes free. When a START condition is transmitted, the Serial Interrupt flag (SI) is set, the Interrupt line (INT) goes LOW and the status code in the status register (I2CSTA) will be 08h. This status code must be used to vector to an interrupt service routine that loads I2CDAT with the slave address and the data direction bit (SLA+R). The byte count register (I2CCOUNT) needs to be programmed with the number of bytes that need to be received in a single sequence (BC[6:0]). LB bit is programmed with logic 0 if the last received byte needs to be acknowledged (read operation still ongoing) or with logic 1 if the last received byte needs to be not acknowledged (read operation ends so the PCA9665 can issue a STOP or Re-START condition). A write to I2CCON resets the SI bit, clears the Interrupt (INT goes HIGH) and allows the serial transfer to continue. When the slave address and the data direction bit have been transmitted and all the data bytes have been received, the Serial Interrupt flag (SI) is set again, the Interrupt line (INT) goes LOW again and I2CSTA is loaded with the following possible codes:
* 48h if a no acknowledgment bit (NACK) has been received for the slave address with
direction bit
* 50h when all the bytes have been received and an acknowledgement bit (ACK) has
been returned for all the bytes
* 58h when all the bytes have been received and an acknowledgement bit (ACK) has
been returned for all the bytes except the last one
* 38h if the PCA9665 lost the arbitration * B0h if the PCA9665 lost the arbitration and is addressed as a slave transmitter (slave
mode enabled with AA = 1)
* 68h if the PCA9665 lost the arbitration and is addressed as a slave receiver (slave
mode enabled with AA = 1)
* D8h if the PCA9665 lost the arbitration and is addressed as a slave receiver during a
General Call sequence (slave mode enabled with AA = 1 and General Call address enabled with GC = 1 in I2CADR register). The appropriate action to be taken for each of these status codes is detailed in Table 36. ENSIO is not affected by the serial transfer and is not referred to in Table 36. After a repeated START condition (state 10h), the PCA9665 may switch to the Master Transmitter mode by loading I2CDAT with SLA+W. Remark: A master should not transmit its own slave address.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
36 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
MR
successful reception from a Slave Transmitter
S
SLA
R
A
(2)
DATA
A
DATA
A
DATA
A
P
08h next transfer started with a repeated START condition
50h
(3)
58h
(4)
F8h
S
SLA
R
10h Not Acknowledge received after the slave address A P W
48h
F8h to Master Transmitter mode entry = MT(5)
arbitration lost in slave address or Acknowledge bit
A or A
other MST continues
A
other MST continues
38h
38h
arbitration lost and addressed as slave
A
other MST continues to corresponding states in Slave Transmitter mode to corresponding states in Slave Receiver mode to corresponding states in Slave Receiver mode (General Call)
B0h from master to slave from slave to master A n 68h D8h
DATA
any number of data bytes and their associated Acknowledge bits This number (contained in I2CSTA) corresponds to a defined state of the I2C-bus.(1)
002aab660
(1) See Table 28. (2) No serial interrupt. (3) Defined state when LB = 0 and the number of bytes received is equal to the value in I2CCOUNT register. (4) Defined state when LB = 1 and the number of bytes received is equal to the value in I2CCOUNT register. (5) Master Transmitter Byte mode is entered with MODE = 0. Master Transmitter Buffered mode is entered when MODE = 1.
Fig 12. Format and states in the Master Receiver Buffered mode (MODE = 1)
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
37 of 91
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx
Product data sheet Rev. 02 -- 7 December 2006 38 of 91
PCA9665_2 (c) NXP B.V. 2006. All rights reserved.
NXP Semiconductors
Table 36.
Master Receiver Buffered mode (MODE = 1) Application software response To/from I2CDAT Load SLA+R To/from I2CCOUNT LB BC[6:0] 0 To I2CCON STA STO SI X 0 AA MODE X 1 SLA+R will be transmitted. If ACK bit received, BC[6:0] data bytes will be received, ACK bit will be returned for all of them. X 0 X 1 SLA+R will be transmitted. If ACK bit received, BC[6:0] data bytes will be received, ACK bit will be returned for all of them, except for the last one where NACK bit will be returned. X 0 X 1 SLA+R will be transmitted. If ACK bit received, BC[6:0] data bytes will be received, ACK bit will be returned for all of them. X 0 X 1 SLA+R will be transmitted. If ACK bit received, BC[6:0] data bytes will be received, ACK bit will be returned for all of them, except for the last one where NACK bit will be returned. X 0 X 1 SLA+W will be transmitted; PCA9665 will be switched to Master Transmitter Buffered mode. 0 0 0 1 1 0 0 0 0 0 X X X X X 1 1 1 1 1 I2C-bus will be released; PCA9665 will enter slave mode. X X X X 1 1 0 1 A START condition will be transmitted when the bus becomes free. Repeated START condition will be transmitted. STOP condition will be transmitted; STO flag will be reset. STOP condition followed by a START condition will be transmitted; STO flag will be reset. Next action taken by the PCA9665
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 08h A START condition has been transmitted
Total number of bytes X to be received
1
Total number of bytes X to be received
10h
A repeated START condition has been transmitted
Load SLA+R or
0
Total number of bytes X to be received
1
Total number of bytes X to be received
Load SLA+W and X the data bytes
Total number of bytes X to be transmitted (= SLA+W + number of data bytes) X 0
Fm+ parallel bus to I2C-bus controller
38h
Arbitration lost in NACK bit
No I2CDAT action X or No I2CDAT action X
48h
SLA+R has been transmitted; NACK has been received
No I2CDAT action X or No I2CDAT action X or No I2CDAT action X
PCA9665
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx
Table 36. Master Receiver Buffered mode (MODE = 1) ...continued Application software response To/from I2CDAT Read data bytes or Read data bytes or Read data bytes or Read data bytes or Read data bytes To/from I2CCOUNT LB BC[6:0] 0 1 To I2CCON STA STO SI 0 0 0 0 AA MODE X X 1 1 BC[6:0] data bytes will be received, ACK bit will be returned for all of them BC[6:0] data bytes will be received, ACK bit will be returned for all of them, except for the last one where NACK bit will be returned Repeated START condition will be transmitted STOP condition will be transmitted; STO flag will be reset. X X 1 1 0 X 1 STOP condition followed by a START condition will be transmitted; STO flag will be reset. Next action taken by the PCA9665
Product data sheet Rev. 02 -- 7 December 2006
(c) NXP B.V. 2006. All rights reserved. PCA9665_2
NXP Semiconductors
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 50h BC[6:0] data bytes have been received; ACK has been returned for all the bytes BC[6:0] data bytes have been received; ACK has been returned for all the bytes, except for the last one where NACK bit has been returned
Total number of bytes 0 to be received Total number of bytes 0 to be received X X 1 0
58h
X X
0 1
0 0
X X
1 1
Fm+ parallel bus to I2C-bus controller
PCA9665
39 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
8.4.3 Slave Receiver Buffered mode
In the Slave Receiver Buffered mode, a number of data bytes are received from a master transmitter several bytes at a time (see Figure 13). To initiate the Slave Receiver Byte mode, I2CADR and I2CCON must be loaded as shown in Table 37 and Table 38.
Table 37. Bit Symbol Value I2CADR initialization 7 AD7 6 AD6 5 AD5 4 AD4 own slave address 3 AD3 2 AD2 1 AD1 0 GC X
The upper 7 bits are the I2C-bus address to which PCA9665 will respond when addressed by a master. GC is the control bit that allows the PCA9665 to respond or not to the General Call address (00h). When programmed to logic 1, the PCA9665 will acknowledge the General Call address. When programmed to logic 0, the PCA9665 will not acknowledge the General Call address.
Table 38. Bit Symbol Value Table 39. Bit Symbol Value I2CCON initialization 7 AA 1 6 ENSIO 1 5 STA 0 4 STO 0 3 SI 0 2 X 1 X 0 MODE 1
I2CCOUNT programming 7 LB X 6 BC6 5 BC5 4 BC4 3 BC3 2 BC2 1 BC1 0 BC0
number of bytes received in a single sequence (1 byte to 68 bytes)
ENSIO must be set to logic 1 to enable the I2C-bus interface. The AA bit must be set to enable the PCA9665 to acknowledge its own slave address; STA, STO, and SI must be reset. When I2CADR and I2CCON have been initialized, the PCA9665 waits until it is addressed by its own slave address followed by the data direction bit which must be `0' (W) to operate in the Slave Receiver mode. After its own slave address and the W bit have been received, the Serial Interrupt flag (SI) is set, the Interrupt line (INT) goes LOW and I2CSTA is loaded with 60h. This status code is used to vector to an interrupt service routine, and the appropriate action to be taken is detailed in Table 40. The Slave Receiver Buffered mode may also be entered when:
* The arbitration is lost while the PCA9665 is in the master mode. See status 68h and
D8h.
* The General Call Address (00h) has been received (General Call address enabled
with GC = 1). See status D0h. Appropriate actions to be taken from these status codes are also detailed in Table 40. The byte count register (I2CCOUNT) is programmed with the number of bytes that need to be sent in a single sequence (BC[6:0]) as shown in Table 39.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
40 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
If the LB bit is reset (logic 0), the PCA9665 will return an acknowledge for all the bytes that will be received. The maximum number of bytes that are received in a single sequence is defined by BC[6:0] in I2CCOUNT register as shown in Table 39. If the LB bit is set (logic 1) during a transfer, the PCA9665 will return a not acknowledge (logic 1) on SDA after receiving the last byte. If the AA bit is reset, the I2C-bus state machine does not respond to its own slave address. However, the I2C-bus is still monitored and address recognition may be resumed at any time by setting AA. This means that the AA bit may be used to temporarily isolate the PCA9665 from the I2C-bus.
(4)
reception of own slave address and one or more data bytes; all are Acknowledged last data byte received is Not Acknowledged
S
SLA
W
A 60h
DATA
A
DATA
A 80h
(2)
DATA
A 80h
(2)
P or S A0h P or S F8h on STOP
A A 68h P or S F8h on STOP A
(4)
arbitration lost as MST and addressed as slave
88h
(3)
reception of the General Call address and one or more data bytes last data byte received is Not Acknowledged
S
GENERAL CALL = 00h
W
A D0h
DATA
DATA
A E0h
(2)
DATA
A E0h
(2)
P or S A0h P or S F8h on STOP
A A D8h E8h
(3)
arbitration lost as MST and addressed as slave by General Call from master to slave
P or S from slave to master any number of data bytes and their associated Acknowledge bits This number (contained in I2CSTA) corresponds to a defined state of the I2C-bus.(1) F8h on STOP
DATA
A
n
002aab661
(1) See Table 40. (2) Defined state when the number of bytes received is equal to the value in I2CCOUNT register and LB = 0. (3) Defined state when the number of bytes received is equal to the value in I2CCOUNT register and LB = 1. (4) Number of bytes received is lower than I2CCOUNT.
Fig 13. Format and states in the Slave Receiver Buffered mode (MODE = 1)
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
41 of 91
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx
Product data sheet Rev. 02 -- 7 December 2006
(c) NXP B.V. 2006. All rights reserved. PCA9665_2
NXP Semiconductors
Table 40.
Slave Receiver Buffered mode (MODE = 1) Application software response To/from I2CDAT To/from I2CCOUNT LB BC[6:0] No I2CDAT action 0 or No I2CDAT action 1 Total number of bytes to be received Total number of bytes to be received To I2CCON STA STO SI X X 0 AA MODE X 1 Up to BC[6:0] data bytes will be received, ACK bit will be returned for all of them. Up to BC[6:0] data bytes will be received, ACK bit will be returned for all of them, except for the last one where NACK bit will be returned (unless master transmitter sends a STOP or Repeated START condition before). Up to BC[6:0] data bytes will be received, ACK bit will be returned for all of them. Up to BC[6:0] data bytes will be received, ACK bit will be returned for all of them, except for the last one where NACK bit will be returned (unless master transmitter sends a STOP or Repeated START condition before). Up to BC[6:0] data bytes will be received, ACK bit will be returned for all of them. Up to BC[6:0] data bytes will be received, ACK bit will be returned for all of them, except for the last one where NACK bit will be returned (unless master transmitter sends a STOP or Repeated START condition before). Up to BC[6:0] data bytes will be received, ACK bit will be returned for all of them. Up to BC[6:0] data bytes will be received, ACK bit will be returned for all of them, except for the last one where NACK bit will be returned (unless master transmitter sends a STOP or Repeated START condition before). Next action taken by the PCA9665
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 60h Own SLA+W has been received; ACK has been returned
X
X
0
X
1
68h
No I2CDAT action 0 Arbitration lost in SLA+R/W as master; or Own SLA+W has been received; ACK has been returned No I2CDAT action 1
Total number of bytes to be received Total number of bytes to be received
X
X
0
X
1
X
X
0
X
1
D0h
General Call address No I2CDAT action 0 (00h) has been or received; ACK has been returned. No I2CDAT action 1
Total number of bytes to be received Total number of bytes to be received
X
X
0
X
1
X
X
0
X
1
Fm+ parallel bus to I2C-bus controller
D8h
Arbitration lost in SLA = R/W as master;
No I2CDAT action 0 or
Total number of bytes to be received Total number of bytes to be received
X
X
0
X
1
General Call address No I2CDAT action 1 has been received; ACK bit has been returned.
X
X
0
X
1
PCA9665
42 of 91
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx
Table 40. Slave Receiver Buffered mode (MODE = 1) ...continued Application software response To/from I2CDAT To/from I2CCOUNT LB BC[6:0] 0 Total number of bytes to be received Total number of bytes to be received To I2CCON STA STO SI X X 0 AA MODE X 1 Up to BC[6:0] data bytes will be received, ACK bit will be returned for all of them. Up to BC[6:0] data bytes will be received, ACK bit will be returned for all of them, except for the last one where NACK bit will be returned (unless master transmitter sends a STOP or Repeated START condition before). Switched to not addressed slave mode; No recognition of own slave address; General Call address will be recognized if GC = 1. Switched to not addressed slave mode; Own slave address will be recognized; General Call address will be recognized if GC = 1. Switched to not addressed slave mode; No recognition of own slave address; General Call address will be recognized if GC = 1; A START condition will be transmitted when the bus becomes free. Switched to not addressed slave mode; Own slave address will be recognized; General Call address will be recognized if GC = 1; A START condition will be transmitted when the bus becomes free. BC[6:0] data bytes will be received, ACK bit will be returned for all of them. BC[6:0] data bytes will be received, ACK bit will be returned for all of them, except for the last one where NACK bit will be returned (unless master transmitter sends a STOP or Repeated START condition before). Next action taken by the PCA9665
Product data sheet Rev. 02 -- 7 December 2006 43 of 91
PCA9665_2 (c) NXP B.V. 2006. All rights reserved.
NXP Semiconductors
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 80h
Previously addressed Read data bytes or with own slave address; BC[6:0] data bytes have been received; ACK has been returned for all the bytes Read data bytes
1
X
X
0
X
1
88h
Previously addressed Read data bytes or with own slave address; BC[6:0] data bytes have been received; ACK has been returned for all the bytes, except for the last one where NACK bit has been returned Read data bytes or Read data bytes or
X
X
0
X
0
0
1
X
X
0
X
0
1
1
X
X
1
X
0
0
1
Read data bytes
X
X
1
X
0
1
1
Fm+ parallel bus to I2C-bus controller
E0h
Previously addressed Read data bytes or with General Call; BC[6:0] data bytes have been received; Read data bytes ACK has been returned for all the bytes
0
Total number of bytes to be received Total number of bytes to be received
X
X
0
X
1
1
X
X
0
X
1
PCA9665
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx
Table 40. Slave Receiver Buffered mode (MODE = 1) ...continued Application software response To/from I2CDAT Read data bytes or Read data bytes or Read data bytes or To/from I2CCOUNT LB BC[6:0] X X To I2CCON STA STO SI 0 X 0 AA MODE 0 1 Switched to not addressed slave mode; No recognition of own slave address; General Call address will be recognized if GC = 1 Switched to not addressed slave mode; Own slave address will be recognized; General Call address will be recognized if GC = 1 Switched to not addressed slave mode; No recognition of own slave address; General Call address will be recognized if GC = 1; A START condition will be transmitted when the bus becomes free. Switched to not addressed slave mode; Own slave address will be recognized; General Call address will be recognized if GC = 1; A START condition will be transmitted when the bus becomes free. Switched to not addressed slave mode; No recognition of own slave address; General Call address will be recognized if GC = 1 Switched to not addressed slave mode; Own slave address will be recognized; General Call address will be recognized if GC = 1 Switched to not addressed slave mode; No recognition of own slave address; General Call address will be recognized if GC = 1; A START condition will be transmitted when the bus becomes free. Switched to not addressed slave mode; Own slave address will be recognized; General Call address will be recognized if GC = 1; A START condition will be transmitted when the bus becomes free. Next action taken by the PCA9665
Product data sheet Rev. 02 -- 7 December 2006
(c) NXP B.V. 2006. All rights reserved. PCA9665_2
NXP Semiconductors
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 E8h Previously addressed with General Call; BC[6:0] data bytes have been received; ACK has been returned for all the bytes, except for the last one where NACK bit has been returned
X
X
0
X
0
1
1
X
X
1
X
0
0
1
Read data bytes
X
X
1
X
0
1
1
A0h
A STOP condition or repeated START condition has been received while still addressed as slave receiver
No I2CDAT action X or No I2CDAT action X or No I2CDAT action X or
X
0
X
0
0
1
X
0
X
0
1
1
Fm+ parallel bus to I2C-bus controller
X
1
X
0
0
1
No I2CDAT action X
X
1
X
0
1
1
PCA9665
44 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
8.4.4 Slave Transmitter Buffered mode
In the Slave Transmitter Buffered mode, a number of data bytes are transmitted to a master receiver several bytes at a time (see Figure 14). Data transfer is initialized as in the Slave Receiver Buffered mode. When I2CADR and I2CCON have been initialized, the PCA9665 waits until it is addressed by its own slave address followed by the data direction bit which must be `1' (R) for the PCA9665 to operate in the Slave Transmitter mode. After its own slave address and the R bit have been received, the Serial Interrupt flag (SI) is set, the Interrupt line (INT) goes LOW and I2CSTA is loaded with A8h. This status code is used to vector to an interrupt service routine, and the appropriate action to be taken is detailed in Table 41. The Slave Transmitter Buffered mode may also be entered if arbitration is lost while the PCA9665 is in the master mode. See state B0h and appropriate actions in Table 41. The byte count register (I2CCOUNT) is programmed with the number of bytes that need to be sent in a single sequence (BC[6:0]) as shown in Table 39. LB bit is only used for the Receiver Buffered modes and can be programmed to either logic 0 or logic 1. If the AA bit is reset during a transfer, the PCA9665 will transmit all the bytes of the transfer (values defined by BC[6:0]) and enter state C8h. The PCA9665 is switched to the not addressed slave mode and will ignore the master receiver if it continues the transfer. Thus the master receiver receives all `1's as serial data. While AA is reset, the PCA9665 does not respond to its own slave address. However, the I2C-bus is still monitored, and address recognition may be resumed at any time by setting AA. This means that the AA bit may be used to temporarily isolate the PCA9665 from the I2C-bus.
reception of own slave address and transmission of one or more data bytes
S
SLA
R
A
DATA
A
DATA
A
P or S
A8h
B8h
(2)
C0h
(3)
F8h on STOP
arbitration lost as MST and addressed as slave
A
B0h from master to slave last data byte transmitted; switched to Not Addressed slave (AA bit in I2CCON = 0) A ALL '1's P or S
from slave to master any number of data bytes and their associated Acknowledge bits
DATA
A
C8h
(4)
F8h on STOP
002aab662
n
This number (contained in I2CSTA) corresponds to a defined state of the I2C-bus.(1)
(1) See Table 31. (2) Defined state when the number of bytes sent is equal to the value in I2CCOUNT register. (3) Defined state when a NACK is received. The number of bytes transmitted is lower than or equal to the value in the I2CCOUNT register. (4) Defined state after the last byte has been transmitted and the PCA9665 goes to the non-addressed mode (AA = 0) and an ACK is received. The number of bytes that are transmitted is equal to the value in I2CCOUNT register.
Fig 14. Format and states in the Slave Transmitter Buffered mode (MODE = 1)
PCA9665_2 (c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
45 of 91
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx
Product data sheet Rev. 02 -- 7 December 2006
(c) NXP B.V. 2006. All rights reserved. PCA9665_2
NXP Semiconductors
Table 41.
Slave Transmitter Buffered mode (MODE = 1) Application software response To/from I2CDAT Load data bytes or To/from I2CCOUNT LB BC[6:0] X To I2CCON STA STO SI X 0 AA MODE 0 1 Up to BC[6:0] bytes will be transmitted. PCA9665 switches to the not addressed mode after BC[6:0] bytes have been transmitted. Up to BC[6:0] bytes will be transmitted. Up to BC[6:0] bytes will be transmitted. PCA9665 switches to the not addressed mode after BC[6:0] bytes have been transmitted Up to BC[6:0] bytes will be transmitted. Up to BC[6:0] bytes will be transmitted. PCA9665 switches to the not addressed mode after BC[6:0] bytes have been transmitted Up to BC[6:0] bytes will be transmitted. Switched to not addressed slave mode; No recognition of own slave address; General Call address recognized if GC = 1 Next action taken by the PCA9665
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 A8h Own SLA+R has been received; ACK has been returned
Total number of data X bytes to be transmitted
Load data bytes B0h Arbitration lost in SLA+R/W as master; Own SLA+R has been received, ACK has been returned BC[6:0] bytes in I2CDAT have been transmitted; ACK has been received Up to BC[6:0] bytes in I2CDAT have been transmitted; NACK has been received Load data bytes or
X X
Total number of data X bytes to be transmitted Total number of data X bytes to be transmitted
X X
0 0
1 0
1 1
Load data bytes Load data bytes or
X X
Total number of data X bytes to be transmitted Total number of data X bytes to be transmitted
X X
0 0
1 0
1 1
B8h
Load data bytes
X
Total number of data X bytes to be transmitted X 0
X X
0 0
1 0
1 1
C0h
No I2CDAT action X or No I2CDAT action X or No I2CDAT action X or
Fm+ parallel bus to I2C-bus controller
X
0
X
0
1
1
Switched to slave mode; Own slave address will be recognized; General Call address recognized if GC = 1 Switched to not addressed slave mode; No recognition of own slave address; General Call address will be recognized if GC = 1; A START condition will be transmitted when the bus becomes free Switched to slave mode; Own slave address will be recognized; General Call address will be recognized if GC = 1; A START condition will be transmitted when the bus becomes free
X
1
X
0
0
1
PCA9665
No I2CDAT action X
X
1
X
0
1
1
46 of 91
xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxx x x x xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xx xx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxx xxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxx x x xxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxx xxx
Table 41. Slave Transmitter Buffered mode (MODE = 1) ...continued Application software response To/from I2CDAT To/from I2CCOUNT LB BC[6:0] No I2CDAT action X or No I2CDAT action X or No I2CDAT action X or X To I2CCON STA STO SI 0 X 0 AA MODE 0 1 Switched to not addressed slave mode; No recognition of own slave address; General Call address recognized if GC = 1. Switched to slave mode; Own slave address will be recognized; General Call address recognized if GC = 1. Switched to not addressed slave mode; No recognition of own slave address; General Call address will be recognized if GC = 1; A START condition will be transmitted when the bus becomes free. Switched to slave mode; Own slave address will be recognized; General Call address will be recognized if GC = 1; A START condition will be transmitted when the bus becomes free. Next action taken by the PCA9665
Product data sheet Rev. 02 -- 7 December 2006
(c) NXP B.V. 2006. All rights reserved. PCA9665_2
NXP Semiconductors
Status Status of the code I2C-bus and the (I2CSTA) PCA9665 C8h BC[6:0] bytes in I2CDAT have been transmitted (AA = 0); ACK has been received
X
0
X
0
1
1
X
1
X
0
0
1
No I2CDAT action X
X
1
X
0
1
1
Fm+ parallel bus to I2C-bus controller
PCA9665
47 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
8.5 Buffered mode examples
8.5.1 Buffered Master Transmitter mode of operation
1. Program the I2CCOUNT register with the number of bytes that need to be sent to the I2C-bus (BC[6:0] has a value from 01h to 44h). LB bit is used for Receiver mode only and can be set to 0 or 1. 2. Load the data bytes in I2CDAT buffer. The different bytes to be sent will be stored in the PCA9665 buffer. There is no protection against writing over a buffer's boundary. If more than 68 bytes are written to the buffer, the data at address 00h will be overwritten. The number of bytes that needs to be loaded in I2CDAT is equal to BC[6:0] in the I2CCOUNT register. The number of data bytes sent is equal to BC[6:0], therefore, if the number of data bytes loaded is greater than BC[6:0], the additional data will not be sent. If the number of data bytes written to the buffer is less than BC[6:0], the PCA9665 will still send out BC[6:0] data bytes. 3. Program I2CCON register to initiate the Master Transmitter Buffered sequence. In Master mode, if STA = 1, a START command is sent. An interrupt will be asserted and the SI bit is set in the I2CCON register after the START has been sent. The I2CSTA register contains the status of the transmission. MODE bit must be set to `1' each time a write to the I2CCON register is performed. 4. After reading the I2CSTA status register, the I2CCON is programmed with STA = 0. That clears the previous Interrupt. If a START command has been previously sent, the first byte loaded into the buffer and sent to the I2C-bus is interpreted as the I2C-bus address + R/W operation. In transmitter mode, R/W = 0 and the following bytes that are sent to the I2C-bus are interpreted as data bytes. 5. When the sequence has been executed, an Interrupt is asserted and the SI bit is set in the I2CCON register. The I2CSTA register contains the status of the transmission and the I2CCOUNT register contains the number of bytes that have been sent to the I2C-bus as described in Table 42. 6. More sequence (program I2CCOUNT register, load data bytes in I2CDAT buffer, write the I2CCON register to send the data to the I2C-bus, read the I2CSTA register when the sequence has been executed) can be performed as long as a STOP or Repeated START command has not been sent. Master Transmitter Buffered mode ends when the I2CCOUNT register is programmed with STO = 1.
8.5.2 Buffered Master Receiver mode of operation
1. Program the I2CCOUNT register with the number of bytes that need to be read from a slave device in the I2C-bus (BC[6:0] has a value from 01h to 44h). LB bit is used in Receiver mode to let the PCA9665 know if the last byte received must be acknowledged or not. LB = 0: Last received byte is acknowledged and another sequence can be executed. LB = 1: Last received byte is not acknowledged. The last sequence before sending a STOP or Repeated START must be executed with LB = 1. 2. Load the I2C-bus address + R/W = 1 in I2CDAT buffer.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
48 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
3. Program I2CCON register to initiate the Master Receiver Buffered sequence. In Master mode, if STA = 1, a START command is sent. An interrupt will be asserted and the SI bit is set in the I2CCON register after the START has been sent. The I2CSTA register contains the status of the transmission. MODE bit must be set to `1' each time a write to the I2CCON register is performed. 4. After reading the I2CSTA status register, the I2CCON is programmed with STA = 0. That clears the previous Interrupt. If a START command has been previously sent, the I2C-bus address + R/W = 1 byte that has been loaded into the buffer is sent to the I2C-bus, the PCA9665 then becomes a master receiver device and starts receiving data from the addressed slave device. Remark: The PCA9665 is already a master receiver device if a buffered sequence has been previously executed. 5. When the sequence has been executed, an Interrupt is asserted and the SI bit is set in the I2CCON register. The I2CSTA register contains the status of the transmission and the I2CCOUNT register contains the number of bytes that have been received. I2CDAT buffer contains all the data that has been received and can be read by the microcontroller. 6. More sequences (program the I2CCOUNT register, write to the I2CCON register, read the I2CSTA register when sequence has been executed, read the I2CDAT buffer) can be performed as long as a STOP or a Repeated START command has not been sent. To be able to end the reception, the last buffered sequence must be performed with LB = 1. Master Receiver Buffered mode ends when the I2CCOUNT register is programmed with STO = 1.
8.5.3 Buffered Slave Transmitter mode
1. An interrupt is asserted and the SI bit is set in the I2CCON register when the PCA9665's own slave address has been detected on the I2C-bus (AA = 1, own slave address defined in the I2CADR register). In Slave Transmitter mode, R/W = 1. 2. Program the I2CCOUNT register with the number of bytes that need to be sent to the I2C-bus (BC[6:0] has a value from 01h to 44h). LB bit is used for Receiver Buffered mode only. 3. Load the data bytes in I2CDAT buffer. The different bytes to be sent will be stored in the PCA9665 buffer. There is no protection against writing over a buffer's boundary. If more than 68 bytes are written to the buffer, the data at address 00h will be overwritten. The number of bytes that needs to be loaded in I2CDAT is equal to BC[6:0] in the I2CCOUNT register. The number of data bytes sent is equal to BC[6:0], therefore, if the number of data bytes loaded is greater than BC[6:0], the additional data will not be sent. If the number of data bytes written to the buffer is less than BC[6:0], the PCA9665 will still send out BC[6:0] data bytes. 4. The I2CCON is programmed to clear the previous Interrupt. The bytes loaded into the buffer are sent to the I2C-bus. MODE bits must be set to `1' each time a write to the I2CCON register is performed. 5. When the sequence has been executed (BC[6:0] bytes sent or the master sent a NACK), an Interrupt is asserted and the SI bit is set in the I2CCON register. The I2CSTA register contains the status of the transmission and the I2CCOUNT register contains the number of bytes that have been sent to the I2C-bus.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
49 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
6. More sequences (program I2CCOUNT register, load data bytes in I2CDAT buffer, write the I2CCON register to send the data to the I2C-bus, read the I2CSTA register when sequence has been executed) can be performed as long as the master acknowledges the bytes sent by the PCA9665 and AA = 1. Slave Transmitter Buffered mode ends when the I2C-bus master does not acknowledge a byte or when the PCA9665 goes to Non-addressed Slave mode.
8.5.4 Buffered Slave Receiver mode
1. An interrupt is asserted and the SI bit is set in the I2CCON register when the PCA9665`s own slave address has been detected in the I2C-bus (AA = 1, own slave address defined in the I2CADR register). In Slave Receiver mode, R/W = 0. 2. Program the I2CCOUNT register with the number of bytes that needs to be read from a master device in the I2C-bus (BC[6:0] has a value from 01h to 44h). LB bit is used in Receiver mode to let the PCA9665 know if the last byte received must be acknowledged or not. LB = 0: Last received byte is acknowledged and another sequence can be executed. LB = 1: Last received byte is not acknowledged. 3. The I2CCON is programmed to clear the previous Interrupt. The PCA9665 receives data from the I2C-bus master. MODE bit must be set to `1' each time a write to the I2CCON register is performed. 4. When the sequence has been executed (BC[6:0] bytes have been received or the master sent a STOP or Repeated START command), an Interrupt is asserted and the SI bit is set in the I2CCON register. The I2CSTA register contains the status of the transmission and the I2CCOUNT register contains the number of bytes that have been received. I2CDAT buffer contains all the data that has been received and can be read by the microcontroller. 5. More sequence (program the I2CCOUNT register, write to the I2CCON register, read the I2CDAT buffer) can be performed as long as a STOP or a Repeated START command has not been sent by the I2C-bus master. Slave Receiver Buffered mode ends when the I2C-bus master sends a STOP or Repeated START command, or when the PCA9665 does not acknowledge the received bytes any more.
8.5.5 Example: Read 128 bytes in two 64-byte sequences of an EEPROM (I2C-bus address = A0h for write operations and A1h for read operations) starting at Location 08h
1. Program I2CCOUNT = 02h (2 bytes to be sent): I2C-bus slave address and memory allocation. 2. Write A0h (I2C-bus slave address and write command) and 08h (Location) into the I2CDAT register. 3. Program I2CCON with STA = 1, STO = SI = 0, MODE = 1. - the PCA9665 sends a START command - the PCA9665 sends an interrupt, sets SI = 1 and updates I2CSTA register - I2CSTA reads 08h 4. Program I2CCON with STA = STO = SI = 0, MODE = 1. - I2C-bus slave address A0h, then EEPROM sub address 08h is sent on the bus
PCA9665_2 (c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
50 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
- the SCL line is held LOW by the PCA9665 after the 2 bytes have been sent - the PCA9665 sends an Interrupt, sets SI = 1 and updates I2CSTA register - I2CSTA reads 28h 5. Program I2CCOUNT = 40h (64 bytes to read and Last byte acknowledged). 6. Load I2CDAT with A1h (I2C-bus slave address and Read command). 7. Program I2CCON with STA = 1, SI = 0, MODE = 1. - the PCA9665 sends a ReSTART command - an interrupt is asserted and the I2CSTA register is updated - the I2CSTA register reads 10h 8. Program I2CCON with STA = STO = SI = 0, MODE = 1. - address A1h is sent followed by a read of 64 data bytes - the last data byte is acknowledged - the SCL line is held LOW by the PCA9665 after the data is read - the PCA9665 sends an interrupt and updates I2CSTA register - I2CSTA reads 50h 9. The microcontroller reads the 64 data bytes from the PCA9665. 10. Program I2CCOUNT = C0h (64 bytes and Last byte is not acknowledged). 11. Program I2CCON with STA = STO = SI = 0, MODE = 1. 12. The PCA9665 reads 64 bytes and does not acknowledge the last byte. - the PCA9665 sends an Interrupt and updates I2CSTA register - the I2CSTA reads 58h - the SCL line is held LOW by the PCA9665 - the slave should release the SDA line 13. The microcontroller reads the 64 bytes from the PCA9665. 14. Program I2CCON with SI = STA = 0, ST0 = 1, MODE = X. - the PCA9665 sends a STOP condition - no interrupt is generated by the PCA9665 - the I2CSTA register contains F8h
8.6 I2CCOUNT register
When a write to the I2CCOUNT register is requested, the buffer pointer is reset and points at the first byte. Loading of the data in the I2CDAT buffer then starts at the first byte. Once an operation has been performed (SI = 1 and an interrupt is generated), the I2CCOUNT register contains the number of bytes that have been received (Receiver mode) or the number of bytes that have been sent (Transmitter mode). See Table 42 for more information. In Buffered Transmitter mode, the first byte that is sent to the I2C-bus is always the first byte that has been loaded in the I2CDAT buffer.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
51 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
In Buffered Receiver mode, when an interrupt is generated and SI is set to 1 (after a STOP command or a buffer full condition), the buffer pointer is reset and points at the first received data byte. Reading the I2CCOUNT register then indicates the number of bytes that have been sent or received (BC[6:0]). Reading of the data from I2CDAT buffer can then be initiated starting with the first received byte.
Table 42. I2CCOUNT register value based on the performed operation I2CCOUNT register value don't care 1 1 n+1 n+1 don't care 0 n (if there was no interrupt after slave address was sent) n - 1 (if there was an interrupt after slave address was sent) Master Receiver Buffered mode After START condition After Slave Address Sent + ACK bit received After Slave Address Sent + NACK bit received don't care don't care (because no interrupt received here) 1
Operation performed Master Transmitter Buffered mode After START condition After Slave Address Sent + ACK bit received and interrupt received After Slave Address Sent + NACK bit received After Slave Address Sent + `n' data bytes sent, ACK bit received, both address and `n' data After Slave Address Sent + `n' data bytes sent, last byte After STOP After losing arbitration in Slave Address + W and addressed as slave After losing arbitration in data at nth byte
After losing arbitration in slave address + W and not addressed as slave 0
After Slave Address Sent + `n' data bytes received, ACK bit received for n address and ACK bit returned for `n' data bytes After Slave Address Sent + `n' data bytes received, NACK bit returned for the last byte After STOP n don't care
After losing arbitration in Slave Address + R bit and addressed as slave 0 After losing arbitration in slave address + R and not addressed as slave 0 After losing arbitration in ACK of nth byte n Slave Receiver Buffered mode (regular slave mode and General Call response After Slave Address + W and ACK bit returned for slave address (both in 0 regular mode and when PCA9665 loses arbitration and is addressed as slave) After receiving `n' bytes, ACK bit returned for the `n' bytes After receiving `n' bytes, NACK bit returned for the last byte Slave Transmitter Buffered mode After Slave Address + R and ACK bit returned for slave address (both in 0 regular mode and when PCA9665 loses arbitration and is addressed as slave) After `n' data bytes transmitted and ACK bit received for `n' bytes After `n' data bytes transmitted and NACK bit received for the last byte n n n n
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
52 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Remark: Request to send or receive a number of bytes equal to 0 or higher than 68 (BC[6:0] = 000 0000 or BC[6:0] > 100 0100) will cause no data to be transferred and an interrupt to be generated after writing to the I2CCON register. I2CSTA status register is loaded with FCh that indicates that an invalid value was requested to be loaded in I2CCOUNT.
8.7 Acknowledge management (I2C-bus addresses and data) in Byte and Buffered modes
Data acknowledge/not acknowledge management can be controlled on a byte basis (Byte mode) or on a sequence basis (Buffered mode). The PCA9665 can be programmed to respond (ACK) or not (NACK) to two different I2C-bus addresses. Table 43 shows how this is performed based on the different control bits (AA, GC, LB and MODE) and the different modes.
Table 43. AA 0 1 X X GC X X X X Own slave address, General Call address, and Data acknowledge management LB X X 0 1 MODE 0 0 1 1 Address not applicable not applicable not applicable not applicable Data received[1] data (each byte) = NACK data (each byte) = ACK all the bytes (BC[6:0] bytes) = ACK all the bytes except the last one (BC[6:0] bytes - 1) = ACK; last byte = NACK data (each byte) = NACK data (each byte) = ACK all the bytes ( BC[6:0] bytes) = ACK all the bytes except the last one (BC[6:0] bytes - 1) = ACK; last byte = NACK[2] all the bytes ( BC[6:0] bytes) = ACK all the bytes except the last one (BC[6:0] bytes - 1) = ACK; last byte = NACK[2] data (each byte) = NACK data (each byte) = NACK data (each byte) = ACK data (each byte) = NACK all the bytes ( BC[6:0] bytes) = ACK all the bytes except the last one (BC[6:0] bytes - 1) = ACK; last byte = NACK[2]
Master mode: the PCA9665 generates a START command and controls the I2C-bus
Slave mode: I2C-bus message starting with the PCA9665's Own Slave address 0 1 0 0 X X X X X X 0 1 0 0 1 1 Own address = NACK Own address = ACK Own address = NACK Own address = NACK
1 1
X X
0 1
1 1
Own address = ACK Own address = ACK
Slave mode: I2C-bus message starting with the General Call address X 0 1 X X X 0 1 1 0 1 1 X X X X 0 1 0 0 0 1 1 1 GC address = NACK GC address = ACK GC address = ACK GC address = NACK GC address = ACK GC address = ACK
[1] [2]
Assumption is that Data Received follows the address (as defined in column "Address"); valid for slave mode only. Unless the master sends a STOP command before.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
53 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Table 44. Control bits AA = 0
Unbuffered Mode (MODE = 0) LB = x Master Transmitter mode Master Receiver mode
*
address/data are transmitted on a byte basis
* *
address is transmitted and data are received on a byte basis NACK returned after one byte received NACK returned after own slave address received NACK returned after one byte received
Slave Transmitter mode
Slave Receiver mode
* *
AA = 1
NACK returned after own slave address received switch to not addressed slave mode any time during an I2C-bus sequence address/data are transmitted on a byte basis
* * * * * *
Master Transmitter mode
Master Receiver mode data are received on a byte basis ACK returned after one byte received ACK returned after own slave address received ACK returned after one byte received
*
Slave Transmitter mode
Slave Receiver mode
* *
ACK returned after own slave address received always addressed during an I2C-bus sequence
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
54 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Table 45. Control bits AA = 0
Buffered Mode (MODE = 1) LB = 0 Master Transmitter mode Master Receiver mode LB = 1 Master Transmitter mode Master Receiver mode
*
*
address/data are transmitted on a multiple byte basis = BC[6:0] value
address is transmitted and data are received on a multiple byte basis = BC[6:0] value ACK returned after the last byte of a buffered sequence received (after bytes received = BC[6:0] value)
*
address/data are transmitted on a multiple byte basis = BC[6:0] value
*
address is transmitted and data are received on a multiple byte basis = BC[6:0] value NACK returned after the last byte of a buffered sequence received (after bytes received = BC[6:0] value) NACK returned after own slave address received in addressed mode, data are received on a multiple byte basis = BC[6:0] value in addressed mode, NACK returned after the last byte of a buffered sequence received (after bytes received = BC[6:0] value) in addressed mode, switch to non-addressed mode after the last byte of a buffered sequence is received (after bytes received = BC[6:0] value)
*
*
Slave Transmitter mode
Slave Receiver mode
Slave Transmitter mode
Slave Receiver mode
* *
* *
NACK returned after own slave address received in addressed mode, data are transmitted on a multiple byte basis = BC[6:0] value in addressed mode, switch to non addressed mode after the last byte of a buffered sequence is transmitted (after bytes sent = BC[6:0] value)
NACK returned after own slave address received in addressed mode, data are received on a multiple byte basis = BC[6:0] value in addressed mode, ACK returned after the last byte of a buffered sequence received (after bytes received = BC[6:0] value) in addressed mode, switch to non-addressed mode after the last byte of a buffered sequence is received (after bytes received = BC[6:0] value)
* *
NACK returned after own slave address received in addressed mode, data are transmitted on a multiple byte basis = BC[6:0] value in addressed mode, switch to non addressed mode after the last byte of a buffered sequence is transmitted (after bytes sent = BC[6:0] value)
* *
*
*
*
*
*
*
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
55 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Table 45. Control bits AA = 1
Buffered Mode (MODE = 1) ...continued LB = 0 Master Transmitter mode Master Receiver mode LB = 1 Master Transmitter mode Master Receiver mode
*
*
address/data are transmitted on a multiple byte basis = BC[6:0] value
address is transmitted and data are received on a multiple byte basis = BC[6:0] value ACK returned after the last byte of a buffered sequence received (after bytes received = BC[6:0] value)
*
address/data are transmitted on a multiple byte basis = BC[6:0] value
*
address is transmitted and data are received on a multiple byte basis = BC[6:0] value NACK returned after the last byte of a buffered sequence received (after bytes received = BC[6:0] value) ACK returned after own slave address received in addressed mode, data are received on a multiple byte basis = BC[6:0] value in addressed mode, NACK returned after the last byte of a buffered sequence received (after bytes received = BC[6:0] value)
*
*
Slave Transmitter mode
Slave Receiver mode
Slave Transmitter mode
Slave Receiver mode
* *
* *
ACK returned after own slave address received in addressed mode, data are transmitted on a multiple byte basis = BC[6:0] value always addressed during a buffered sequence
ACK returned after own slave address received in addressed mode, data are received on a multiple byte basis = BC[6:0] value in addressed mode, ACK returned after the last byte of a buffered sequence received (after bytes received = BC[6:0] value)
* *
ACK returned after own slave address received in addressed mode, data are transmitted on a multiple byte basis = BC[6:0] value always addressed during a buffered sequence
* *
*
*
*
*
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
56 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
8.8 Miscellaneous states
There are four I2CSTA codes that do not correspond to a defined PCA9665 state (see Table 46). These are discussed in Section 8.8.1 through Section 8.8.4.
Table 46. Miscellaneous states Next action taken by PCA9665 AA X 0 MODE X X Go into master mode; send START No recognition of own slave address. General Call address will be recognized if GC = 1. Will recognize own slave address. General Call address will be recognized if GC = 1. Hardware or software reset of the PCA9665 (requires reset to return to state F8h) Hardware or software reset of the PCA9665 (requires reset to return to state F8h) Program a valid value in I2CCOUNT: BC[6:0] between 1 and 68. Hardware or software reset of the PCA9665 (requires reset to return to state F8h)
Status Status of the I2C-bus Application software response code and the PCA9665 To/from I2CDAT To I2CCON (I2CSTA) STA STO SI F8h On hardware or software reset or STOP No I2CDAT action 1 No I2CDAT action 0 X X 0 0
No I2CDAT action 0
X
0
1
X
70h
Bus error SDA stuck LOW
No I2CDAT action No I2CCON action
78h
Bus error SCL stuck LOW
No I2CDAT action No I2CCON action
FCh
Illegal value in I2CCOUNT
No I2CDAT action No I2CCON action
00h
No I2CDAT action No I2CCON action Bus error during master or slave mode, due to illegal START or STOP condition
8.8.1 I2CSTA = F8h
This status code indicates that the PCA9665 is in an idle state and that no relevant information is available because the serial interrupt flag, SI, is not yet set. This occurs on a STOP condition or during a hardware or software reset event and when the PCA9665 is not involved in a serial transfer.
8.8.2 I2CSTA = 00h
This status code indicates that a bus error has occurred during a serial transfer. A bus error is caused when a START or STOP condition occurs at an illegal position in the format frame. Examples of such illegal positions are during the serial transfer of an address byte, a data byte, or an acknowledge bit. A bus error may also be caused when external interference disturbs the internal PCA9665 signals. When a bus error occurs, SI is set. To recover from a bus error, the microcontroller must send an external hardware or software reset signal to reset the PCA9665.
8.8.3 I2CSTA = 70h
This status code indicates that the SDA line is stuck LOW when the PCA9665, in master mode, is trying to send a START condition.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
57 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
8.8.4 I2CSTA = 78h
This status code indicates that the SCL line is stuck LOW.
8.9 Some special cases
The PCA9665 has facilities to handle the following special cases that may occur during a serial transfer.
8.9.1 Simultaneous repeated START conditions from two masters
A repeated START condition may be generated in the Master Transmitter or Master Receiver modes. A special case occurs if another master simultaneously generates a repeated START condition (see Figure 15). Until this occurs, arbitration is not lost by either master since they were both transmitting the same data. If the PCA9665 detects a repeated START condition on the I2C-bus before generating a repeated START condition itself, it will use the repeated START as its own and continue with the sending of the slave address.
S
SLA
W
A
DATA
A
S
both masters continue with SLA transmission
08h
18h
28h other master sends repeated START condition earlier
002aab028
Fig 15. Simultaneous repeated START conditions from 2 masters
8.9.2 Data transfer after loss of arbitration
Arbitration may be lost in the Master Transmitter and Master Receiver modes. Loss of arbitration is indicated by the following states in I2CSTA; 38h, 68h, and B0h (see Figure 7, Figure 11, Figure 8, and Figure 12). Remark: In order to exit state 38h, a Time-out, Reset, or external STOP are required. If the STA flag in I2CCON is set by the routines which service these states, then, if the bus is free again, a START condition (state 08h) is transmitted without intervention by the CPU, and a retry of the total serial transfer can commence.
8.9.3 Forced access to the I2C-bus
In some applications, it may be possible for an uncontrolled source to cause a bus hang-up. In such situations, the problem may be caused by interference, temporary interruption of the bus or a temporary short-circuit between SDA and SCL. If an uncontrolled source generates a superfluous START or masks a STOP condition, then the I2C-bus stays busy indefinitely. If the STA flag is set and bus access is not obtained within a reasonable amount of time, then a forced access to the I2C-bus is possible. If the I2C-bus stays idle for a time period equal to the time-out period, then the PCA9665 concludes that no other master is using the bus and sends a START condition.
PCA9665_2 (c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
58 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
time-out STA flag
SDA line
SCL line START condition
002aab029
Fig 16. Forced access to a busy I2C-bus
8.9.4 I2C-bus obstructed by a LOW level on SCL or SDA
An I2C-bus hang-up occurs if SDA or SCL is pulled LOW by an uncontrolled source. If the SCL line is obstructed (pulled LOW) by a device on the bus, no further serial transfer is possible, and the PCA9665 cannot resolve this type of problem. When this occurs, the problem must be resolved by the device that is pulling the SCL bus line LOW. When the SCL line stays LOW for a period equal to the time-out value, the PCA9665 concludes that this is a bus error and behaves in a manner described in Section 7.3.2.4 "The Time-out register, I2CTO (indirect address 04h)". If the SDA line is obstructed by another device on the bus (e.g., a slave device out of bit synchronization), the problem can be solved by transmitting additional clock pulses on the SCL line (see Figure 17). The PCA9665 sends out nine clock pulses followed by the STOP condition. If the SDA line is released by the slave pulling it LOW, a normal START condition is transmitted by the PCA9665, state 08h is entered and the serial transfer continues. If the SDA line is not released by the slave pulling it LOW, then the PCA9665 concludes that there is a bus error, loads 70h in I2CSTA, generates an interrupt signal, and releases the SCL and SDA lines. After the microcontroller reads the status register, it needs to send a reset signal (hardware through the RESET pin, or software through the parallel port) in order to reset the PCA9665. See Section 8.11 "Reset" for more information. If a forced bus access occurs or a repeated START condition is transmitted while SDA is obstructed (pulled LOW), the PCA9665 performs the same action as described above. In each case, state 08h is entered after a successful START condition is transmitted and normal serial transfer continues. Note that the CPU is not involved in solving these bus hang-up problems.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
59 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
STA flag
SDA line
1 SCL line
2
3
4
5
6
7
8
9
STOP condition
START condition
002aab030
Fig 17. Recovering from a bus obstruction caused by a LOW level on SDA
8.9.5 Bus error
A bus error occurs when a START or STOP condition is present at an illegal position in the format frame. Examples of illegal positions are during the serial transfer of an address byte, a data or an acknowledge bit. The PCA9665 only reacts to a bus error when it is involved in a serial transfer either as a master or an addressed slave. When a bus error is detected, PCA9665 releases the SDA and SCL lines, sets the interrupt flag, and loads the status register with 00h. This status code may be used to vector to a service routine which either attempts the aborted serial transfer again or simply recovers from the error condition as shown in Table 46 "Miscellaneous states". The microcontroller must send an external hardware or software reset signal to reset the PCA9665.
8.10 Power-on reset
When power is applied to VDD, an internal Power-On Reset holds the PCA9665 in a reset condition until VDD has reached VPOR. At this point, the reset condition is released and the PCA9665 goes to the power-up initialization phase where the following operations are performed: 1. ENSIO bit is set to 1 to enable the internal oscillator. 2. Internal register initialization is performed. 3. ENSIO bit is set to 0 to disable the internal oscillator and go to the non-addressed low power mode. The complete power-up initialization phase takes 550 s to be performed. During this time, write to the PCA9665 through the parallel port is not permitted. However, the parallel port can be read. This allows the device connected to the parallel port of the PCA9665 to poll the I2CCON register and read the ENSIO state bit. When ENSIO bit is equal to 1, this means that the power-up initialization is in progress. When ENSIO is set to 0, this means that the power-up initialization is done and that the PCA9665 is initialized and ready to be used.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
60 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
8.11 Reset
Reset of the PCA9665 to its default state can be performed in 2 different ways:
* By holding the RESET pin LOW for a minimum of tw(rst). * By using the Parallel Software Reset sequence as described in Figure 18.
access to INDPTR Indirect Register pointer A[1:0] 00 I2CPRESET register selected D[7:0] 05h SWRST data byte 1 A5h access to the INDIRECT Indirect Data field 10 SWRST data byte 2 5Ah
WR If D[7:0] A5h, following byte is ignored and reset is aborted. internal reset signal If D[7:0] 5Ah, reset is aborted. If SWRST Data 1 = A5h and SWRST Data 2 = 5Ah, PCA9665 is reset to its default state.
002aab966
Fig 18. Parallel Software Reset sequence
8.12 I2C-bus timing diagrams, Unbuffered mode
The diagrams (Figure 19 through Figure 22) illustrate typical timing diagrams for the PCA9665 in master/slave functions.
SCL
SDA
INT 7-bit address R/W = 0 START condition from slave receiver ACK interrupt first byte interrupt n byte ACK interrupt STOP condition
002aab031
ACK
Master PCA9665 writes data to slave transmitter.
Fig 19. Bus timing diagram; Unbuffered Master Transmitter mode
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
61 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
SCL
SDA
INT 7-bit address R/W = 1 START condition from slave ACK interrupt first byte interrupt n byte no ACK from master receiver STOP condition
002aab032
ACK
Master PCA9665 reads data from slave transmitter.
Fig 20. Bus timing diagram; Unbuffered Master Receiver mode
SCL
SDA
INT
7-bit address(1) R/W = 1
interrupt
first byte
interrupt
n byte no ACK
interrupt STOP condition
002aab033
START condition from slave PCA9665
ACK
ACK
from master receiver
External master receiver reads data from PCA9665. (1) As defined in I2CADR register.
Fig 21. Bus timing diagram; Unbuffered Slave Transmitter mode
SCL
SDA
INT
7-bit address(1) R/W = 0
interrupt
first byte
interrupt
n byte ACK
interrupt
interrupt (after STOP) STOP condition
002aab034
START condition from slave PCA9665
ACK
ACK
Slave PCA9665 is written to by external master transmitter. (1) As defined in I2CADR register.
Fig 22. Bus timing diagram; Unbuffered Slave Receiver mode
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
62 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
8.13 I2C-bus timing diagrams, Buffered mode
The diagrams (Figure 23 through Figure 26) illustrate typical timing diagrams for the PCA9665 in master/slave functions.
SCL
SDA
INT
7-bit address(1) R/W = 0 first byte(1) ACK ACK n byte(1) ACK interrupt STOP condition
002aab267
START condition from slave receiver
Master PCA9665 writes data to slave transmitter. (1) 7-bit address + R/W = 0 byte and number of bytes sent = value programmed in I2CCOUNT register (BC[6:0] 68).
Fig 23. Bus timing diagram; Buffered Master Transmitter mode
SCL
SDA
INT 7-bit address R/W = 1 START condition from slave ACK first byte(1) ACK n byte(1) no ACK from master receiver STOP condition
002aab268
Master PCA9665 reads data from slave transmitter. (1) Number of bytes received = value programmed in I2CCOUNT register (BC[6:0] 68).
Fig 24. Bus timing diagram; Buffered Master Receiver mode
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
63 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
SCL
SDA
INT
7-bit address(1) R/W = 1
interrupt
first byte(2) ACK
n byte(2) no ACK from master receiver
interrupt STOP condition
002aab269
START condition from slave PCA9665
ACK
External master receiver reads data from PCA9665. (1) As defined in I2CADR register. (2) Number of bytes received = value programmed in I2CCOUNT register (BC[6:0] 68).
Fig 25. Bus timing diagram; Buffered Slave Transmitter mode
SCL
SDA
INT
7-bit address(1) R/W = 0
interrupt
first byte(2) ACK
n byte(2) ACK
interrupt
interrupt (after STOP) STOP condition
002aab270
START condition from slave PCA9665
ACK
Slave PCA9665 is written to by external master transmitter. (1) As defined in I2CADR register. (2) Number of bytes received = value programmed in I2CCOUNT register (BC[6:0] 68).
Fig 26. Bus timing diagram; Buffered Slave Receiver mode
SCL
SDA
INT
7-bit SWRST Call address R/W = 0
interrupt
first byte = 0xA5 ACK
second byte = 0x5A ACK
interrupt (after STOP) STOP condition
002aab488
START condition from slave PCA9665
ACK
Fig 27. Bus timing diagram; Software Reset Call
PCA9665_2 (c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
64 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
9. Characteristics of the I2C-bus
The I2C-bus is for 2-way, 2-line communication between different ICs or modules. The two lines are a serial data line (SDA) and a serial clock line (SCL). Both lines must be connected to a positive supply via a pull-up resistor when connected to the output stages of a device. Data transfer may be initiated only when the bus is not busy.
9.1 Bit transfer
One data bit is transferred during each clock pulse. The data on the SDA line must remain stable during the HIGH period of the clock pulse as changes in the data line at this time will be interpreted as control signals (see Figure 28).
SDA
SCL data line stable; data valid change of data allowed
mba607
Fig 28. Bit transfer
9.1.1 START and STOP conditions
Both data and clock lines remain HIGH when the bus is not busy. A HIGH-to-LOW transition of the data line while the clock is HIGH is defined as the START condition (S). A LOW-to-HIGH transition of the data line while the clock is HIGH is defined as the STOP condition (P) (see Figure 29).
SDA
SDA
SCL S START condition P STOP condition
SCL
mba608
Fig 29. Definition of START and STOP conditions
9.2 System configuration
A device generating a message is a `transmitter'; a device receiving is the `receiver'. The device that controls the message is the `master' and the devices which are controlled by the master are the `slaves' (see Figure 30).
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
65 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
SDA SCL MASTER TRANSMITTER/ RECEIVER SLAVE RECEIVER SLAVE TRANSMITTER/ RECEIVER MASTER TRANSMITTER MASTER TRANSMITTER/ RECEIVER I2C-BUS MULTIPLEXER
SLAVE
002aaa966
Fig 30. System configuration
9.3 Acknowledge
The number of data bytes transferred between the START and the STOP conditions from transmitter to receiver is not limited. Each byte of eight bits is followed by one acknowledge bit. The acknowledge bit is a HIGH level put on the bus by the transmitter, whereas the master generates an extra acknowledge related clock pulse. A slave receiver which is addressed must generate an acknowledge after the reception of each byte. Also a master must generate an acknowledge after the reception of each byte that has been clocked out of the slave transmitter. The device that acknowledges has to pull down the SDA line during the acknowledge clock pulse, so that the SDA line is stable LOW during the HIGH period of the acknowledge related clock pulse; set-up and hold times must be taken into account. A master receiver must signal an end of data to the transmitter by not generating an acknowledge on the last byte that has been clocked out of the slave. In this event, the transmitter must leave the data line HIGH to enable the master to generate a STOP condition.
data output by transmitter not acknowledge data output by receiver acknowledge SCL from master S START condition 1 2 8 clock pulse for acknowledgement
002aaa987
9
Fig 31. Acknowledgement on the I2C-bus
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
66 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
10. Application design-in information
VDD
address bus
VDD VDD A0 A1 DECODER ALE CE SCL
8
PCA9665
80C51
D0 to D7 RD VDD WR
SDA
INT VDD RESET VSS
SLAVE INT
SLAVE RESET
VSS
002aab035
Fig 32. Application diagram using the 80C51
10.1 Specific applications
The PCA9665 is a parallel bus to I2C-bus controller that is designed to allow `smart' devices to interface with I2C-bus or SMBus components, where the `smart' device does not have an integrated I2C-bus port and the designer does not want to `bit-bang' the I2C-bus port. The PCA9665 can also be used to add more I2C-bus ports to `smart' devices, provide a higher frequency, lower voltage migration path for the PCF8584 and convert 8 bits of parallel data to a serial bus to avoid running multiple traces across the printed-circuit board.
10.2 Add I2C-bus port
As shown in Figure 33, the PCA9665 converts 8-bits of parallel data into a multiple master capable I2C-bus port for microcontrollers, microprocessors, custom ASICs, DSPs, etc., that need to interface with I2C-bus or SMBus components.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
67 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
control signals MICROCONTROLLER, MICROPROCESSOR, OR ASIC 8 bits data
002aab036
SDA
PCA9665
SCL
Fig 33. Adding I2C-bus port application
10.3 Add additional I2C-bus ports
The PCA9665 can be used to convert 8-bit parallel data into additional multiple master capable I2C-bus port as shown in Figure 34. It is used if the microcontroller, microprocessor, custom ASIC, DSP, etc., already have an I2C-bus port but need one or more additional I2C-bus ports to interface with more I2C-bus or SMBus components or components that cannot be located on the same bus (e.g., 100 kHz and 400 kHz slaves on different buses so that each bus can operate at its maximum potential).
SDA SCL MICROCONTROLLER, MICROPROCESSOR, OR ASIC
control signals
SDA
PCA9665
SCL 8 bits data
002aab037
Fig 34. Adding additional I2C-bus ports application
10.4 Convert 8 bits of parallel data into I2C-bus serial data stream
Functioning as a slave transmitter, the PCA9665 can convert 8-bit parallel data into a two-wire I2C-bus data stream as is shown in Figure 35. This would prevent having to run 8 traces across the entire width of the printed-circuit board.
control signals MICROCONTROLLER, MICROPROCESSOR, OR ASIC 8 bits data
SDA
PCA9665
SCL
MASTER
002aab039
Fig 35. Converting parallel to serial data application
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
68 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
11. Limiting values
Table 47. Limiting values In accordance with the Absolute Maximum Rating System (IEC 60134). Symbol VDD VI II IO Ptot P/out Tstg Tamb
[1]
Parameter supply voltage input voltage input current output current total power dissipation power dissipation per output storage temperature ambient temperature
Conditions any input any input any output
[1]
Min -0.3 -0.8 -10 -10 -65
Max +4.6 +6.0 +10 +10 300 50 +150 +85
Unit V V mA mA mW mW C C
operating
-40
5.5 V steady state voltage tolerance on inputs and outputs is valid only when the supply voltage is present. 4.6 V steady state voltage tolerance on inputs and outputs when no supply voltage is present.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
69 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
12. Static characteristics
Table 48. Static characteristics VDD = 2.3 V to 3.6 V; Tamb = -40 C to +85 C; unless otherwise specified. Symbol Supply VDD IDD VPOR VIL VIH IL Ci VIL VIH IOH IOL IL Cio VIL VIH IL IOL Cio IOL IL Co
[1]
Parameter supply voltage supply current power-on reset voltage LOW-level input voltage HIGH-level input voltage leakage current input capacitance LOW-level input voltage HIGH-level input voltage HIGH-level output current LOW-level output current leakage current input/output capacitance LOW-level input voltage HIGH-level input voltage leakage current LOW-level output current input/output capacitance LOW-level output current leakage current output capacitance
Conditions
Min 2.3
Typ 0.1 1.8 2.0 -7.0 8.0 2.8 5.6 3.8
Max 3.6 3.0 8.0 2.2 0.8 5.5 +1 3 0.8 5.5 +1 4 0.3VDD 5.5 +1 +10 7 +1 5
Unit V mA mA V V V A pF V V mA mA A pF V V A A mA pF mA A pF
standby mode operating mode; no load
0
[1]
Inputs WR, RD, A0, A1, CE, RESET 2.0 -1 0
[1]
input; VI = 0 V or 5.5 V VI = VSS or VDD
Inputs/outputs D0 to D7 2.0 -4.0 4.0 -1 0
[1]
VOH = VDD - 0.4 V VOL = 0.4 V input; VI = 0 V or 5.5 V VI = VSS or VDD
SDA and SCL 0.7VDD -1 -1 20 6.0 -1 -
input/output; VI = 0 V or 3.6 V input/output; VI = 5.5 V VOL = 0.4 V VI = VSS or VDD VOL = 0.4 V VO = 0 V or 3.6 V VI = VSS or VDD
Outputs INT
5.5 V steady state voltage tolerance on inputs and outputs is valid only when the supply voltage is present. 4.6 V steady state voltage tolerance on inputs and outputs when no supply voltage is present.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
70 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
13. Dynamic characteristics
Table 49. Dynamic characteristics (3.3 volt)[1][2][3] VCC = 3.3 V 0.3 V; Tamb = -40 C to +85 C; unless otherwise specified. (See Table 50 on page 72 for 2.5 V) Symbol tinit(po) tinit(sintf) tw(rst) trst trec(rst) tas(int) tdas(int) tsu(A) th(A) tsu(CE_N) th(CE_N) tw(RDL) tw(WRL) td(DV) td(QZ) tsu(Q) th(Q) tw(RDH) tw(WRH)
[1] [2] [3] [4] [5] [6]
Parameter power-on initialization time serial interface initialization time[4] reset pulse width reset time reset recovery time interrupt assert time interrupt de-assert time address setup time address hold time CE setup time CE hold time RD LOW pulse width WR LOW pulse width data valid delay time data output float delay time data output setup time data output hold time RD HIGH pulse width WR HIGH pulse width
Conditions
Min -
Typ -
Max 550 550 500 20 17 17 -
Unit s s ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
Initialization timing Serial interface initialization timing from ENSIO bit HIGH 10
[5][6]
RESET timing (see Figure 36) 250 0 to RD, WR LOW from RD, WR LOW to RD, WR LOW from RD, WR LOW 0 13 0 0 20 20 after RD and CE LOW after RD or CE HIGH before WR or CE HIGH (write cycle) after WR HIGH 12 0 18 18
INT timing (see Figure 37)
Bus timing (see Figure 38 and Figure 40)
Parameters are valid over specified temperature and voltage range. All voltage measurements are referenced to ground (GND). For testing, all inputs swing between 0 V and 3.0 V with a transition time of 5 ns maximum. All time measurements are referenced at input voltages of 1.5 V and output voltages shown in Figure 38 and Figure 40. Test conditions for outputs: CL = 50 pF; RL = 500 , except open-drain outputs. Test conditions for open-drain outputs: CL = 50 pF; RL = 1 k pull-up to VDD. Initialization time for the serial interface after ENSIO bit goes HIGH in a write operation to the control register. Resetting the device while actively communicating on the bus may cause glitches or an errant STOP condition. Upon reset, the full delay will be the sum of trst and the RC time constant of the SDA and SCL bus.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
71 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Table 50. Dynamic characteristics (2.5 volt)[1][2][3] VCC = 2.5 V 0.2 V; Tamb = -40 C to +85 C; unless otherwise specified. (See Table 49 on page 71 for 3.3 V) Symbol tinit(po) tinit(sintf) tw(rst) trst trec(rst) tas(int) tdas(int) tsu(A) th(A) tsu(CE_N) th(CE_N) tw(RDL) tw(WRL) td(DV) td(QZ) tsu(Q) th(Q) tw(RDH) tw(WRH)
[1] [2] [3] [4] [5] [6]
Parameter power-on initialization time serial interface initialization time[4] reset pulse width reset time reset recovery time interrupt assert time interrupt de-assert time address setup time address hold time CE setup time CE hold time RD LOW pulse width WR LOW pulse width data valid delay time data output float delay time data output setup time data output hold time RD HIGH pulse width WR HIGH pulse width
Conditions
Min -
Typ -
Max 550 550 550 20 22 17 -
Unit s s ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns ns
Initialization timing Serial interface initialization timing from ENSIO bit HIGH 10
[5][6]
RESET timing (see Figure 36) 250 0 to RD, WR LOW from RD, WR LOW to RD, WR LOW from RD, WR LOW 0 13 0 0 20 20 after RD and CE LOW after RD or CE HIGH before WR or CE HIGH (write cycle) after WR HIGH 12 0 18 18
INT timing (see Figure 37)
Bus timing (see Figure 38 and Figure 40)
Parameters are valid over specified temperature and voltage range. All voltage measurements are referenced to ground (GND). For testing, all inputs swing between 0 V and 3.0 V with a transition time of 5 ns maximum. All time measurements are referenced at input voltages of 1.5 V and output voltages shown in Figure 38 and Figure 40. Test conditions for outputs: CL = 50 pF; RL = 500 , except open-drain outputs. Test conditions for open-drain outputs: CL = 50 pF; RL = 1 k pull-up to VDD. Initialization time for the serial interface after ENSIO bit goes HIGH in a write operation to the control register. Resetting the device while actively communicating on the bus may cause glitches or an errant STOP condition. Upon reset, the full delay will be the sum of trst and the RC time constant of the SDA and SCL bus.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
72 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
START SCL
ACK or read cycle 30 %
SDA
30 % trst
30 %
RESET
50 % trec(rst)
50 % tw(rst) trst
50 %
Dn
Dn on
30 %
Dn off
002aab272
Fig 36. Reset timing
D7 to D0
write to I2CCON
WR
6 SCL
7
8
9
1
2
3
INT tas(int) tdas(int)
002aac227
Fig 37. Interrupt timing
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
73 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
A0 to A1 tsu(A)
th(A)
CE tsu(CE_N) tw(RDL) RD td(DV) D0 to D7 (read) float not valid td(QZ) th(CE_N) tw(RDH)
valid
float
002aac693
Fig 38. Bus timing (read cycle)
A0 to A1 tsu(A)
th(A)
CE tsu(CE_N) tw(WRL) WR tsu(Q) D0 to D7 (write) valid
002aac692
th(CE_N) tw(WRH)
th(Q)
Fig 39. Parallel bus timing (write cycle)
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
74 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
VI RD, CE input GND VDD Dn output LOW-to-float float-to-LOW VOL t d(QHZ) Dn output HIGH-to-float float-to-HIGH VOH VY VM GND outputs enabled outputs floating outputs enabled
002aab274
VM t d(QLZ)
VM t d(QZL)
VM VX t d(QZH)
VM = 1.5 V VX = VOL + 0.3 V VY = VOH - 0.3 V VOL and VOH are typical output voltage drops that occur with the output load.
Fig 40. Data timing
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
75 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Table 51. I2C-bus frequency and timing specifications All the timing limits are valid within the operating supply voltage and ambient temperature range; VDD = 2.5 V 0.2 V and 3.3 V 0.3 V; Tamb = -40 C to +85 C; and refer to VIL and VIH with an input voltage of VSS to VDD. Symbol Parameter Conditions Standard-mode I2C-bus Min fSCL tBUF SCL clock frequency bus free time between a STOP and START condition hold time (repeated) START condition set-up time for a repeated START condition set-up time for STOP condition data hold time data valid acknowledge time data valid time data set-up time LOW period of the SCL clock HIGH period of the SCL clock fall time of both SDA and SCL signals rise time of both SDA and SCL signals pulse width of spikes that must be suppressed by the input filter
[7] [5][6] [2] [1]
Fast-mode I2C-bus Min 0 1.3 Max 400 -
Fast-mode Plus Unit I2C-bus Min 0 0.5 Max 1000 kHz s
Max 100 -
0 4.7
tHD;STA tSU;STA
4.0 4.7
-
0.6 0.6
-
0.26 0.26
-
s s
tSU;STO tHD;DAT tVD;ACK tVD;DAT tSU;DAT tLOW tHIGH tf tr tSP
4.0 0 0.05 50 250 4.7 4.0 -
3.45 300 1000 50
0.6 0 0.05 50 100 1.3 0.6 20 + 0.1Cb[4] 20 + 0.1Cb[4] -
0.9 300 300 50
0.26 0 0.05 50 50 0.5 0.26 -
0.45 120 120 50
s ns s ns ns s s ns ns ns
[3]
[1] [2] [3] [4] [5] [6]
Minimum SCL clock frequency is limited by the bus time-out feature, which resets the serial bus interface if either SDA or SCL is held LOW for a minimum of 25 ms. Disable bus time-out feature for DC operation. tVD;ACK = time for Acknowledgement signal from SCL LOW to SDA (out) LOW. tVD;DAT = minimum time for SDA data out to be valid following SCL LOW. Cb = total capacitance of one bus line in pF. A master device must internally provide a hold time of at least 300 ns for the SDA signal (refer to the VIL of the SCL signal) in order to bridge the undefined region SCL's falling edge. The maximum tf for the SDA and SCL bus lines is specified at 300 ns. The maximum fall time for the SDA output stage tf is specified at 250 ns. This allows series protection resistors to be connected between the SDA and the SCL pins and the SDA/SCL bus lines without exceeding the maximum specified tf. Input filters on the SDA and SCL inputs suppress noise spikes less than 50 ns.
[7]
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
76 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
SDA tf tLOW tr SCL tHD;STA S tHIGH tSU;STA tHD;DAT tSU;STO Sr P S
002aab271
tSU;DAT tf
tHD;STA
tSP
tBUF tr
Fig 41. Definition of timing on the I2C-bus
protocol
START condition (S) tSU;STA
bit 7 MSB
bit 6
bit n
bit 0
acknowledge (A)
STOP condition (P)
tLOW
tHIGH
1/f
SCL
SCL tBUF tr tf
SDA
tHD;STA
tSU;DAT
tHD;DAT
tVD;DAT
tVD;ACK
tSU;STO
002aac696
Rise and fall times refer to VIL and VIH.
Fig 42. I2C-bus timing diagram
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
77 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
14. Test information
VDD x 2 open VSS
VDD PULSE GENERATOR VI DUT
RT CL 50 pF
VO
RL 500
RL 500
002aac694
Test data are given in Table 52. RL = load resistance. CL = load capacitance includes jig and probe capacitance. RT = termination resistance should be equal to the output impedance ZO of the pulse generators.
Fig 43. Test circuitry for switching times Table 52. Test td(DV) td(QZ) Test data Load CL 50 pF 50 pF RL 500 500 VDD x 2 open S1
VDD PULSE GENERATOR VI DUT
RT
VO
RL 1 k
VDD open VSS
CL 50 pF
002aac695
Test data are given in Table 53. RL = load resistance. RL for SDA and SCL > 1 k (3 mA or less current). CL = load capacitance includes jig and probe capacitance. RT = termination resistance should be equal to the output impedance ZO of the pulse generators.
Fig 44. Test circuitry for open-drain switching times Table 53. Test td(DV) td(QZ) tas(int) tdas(int)
PCA9665_2
Test data Load CL 50 pF 50 pF 50 pF 50 pF RL 1 k 1 k 1 k 1 k VDD VDD VDD VDD
(c) NXP B.V. 2006. All rights reserved.
S1
Product data sheet
Rev. 02 -- 7 December 2006
78 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
15. Package outline
DIP20: plastic dual in-line package; 20 leads (300 mil) SOT146-1
D seating plane
ME
A2
A
L
A1
c Z e b1 b 20 11 MH wM (e 1)
pin 1 index E
1
10
0
5 scale
10 mm
DIMENSIONS (inch dimensions are derived from the original mm dimensions) UNIT mm inches A max. 4.2 0.17 A1 min. 0.51 0.02 A2 max. 3.2 0.13 b 1.73 1.30 0.068 0.051 b1 0.53 0.38 0.021 0.015 c 0.36 0.23 0.014 0.009 D
(1)
E
(1)
e 2.54 0.1
e1 7.62 0.3
L 3.60 3.05 0.14 0.12
ME 8.25 7.80 0.32 0.31
MH 10.0 8.3 0.39 0.33
w 0.254 0.01
Z (1) max. 2 0.078
26.92 26.54 1.060 1.045
6.40 6.22 0.25 0.24
Note 1. Plastic or metal protrusions of 0.25 mm (0.01 inch) maximum per side are not included. OUTLINE VERSION SOT146-1 REFERENCES IEC JEDEC MS-001 JEITA SC-603 EUROPEAN PROJECTION
ISSUE DATE 99-12-27 03-02-13
Fig 45. Package outline SOT146-1 (DIP20)
PCA9665_2 (c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
79 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
SO20: plastic small outline package; 20 leads; body width 7.5 mm
SOT163-1
D
E
A X
c y HE vMA
Z 20 11
Q A2 A1 pin 1 index Lp L 1 e bp 10 wM detail X (A 3) A
0
5 scale
10 mm
DIMENSIONS (inch dimensions are derived from the original mm dimensions) UNIT mm inches A max. 2.65 0.1 A1 0.3 0.1 A2 2.45 2.25 A3 0.25 0.01 bp 0.49 0.36 c 0.32 0.23 D (1) 13.0 12.6 0.51 0.49 E (1) 7.6 7.4 0.30 0.29 e 1.27 0.05 HE 10.65 10.00 L 1.4 Lp 1.1 0.4 Q 1.1 1.0 0.043 0.039 v 0.25 0.01 w 0.25 0.01 y 0.1 Z
(1)
0.9 0.4
0.012 0.096 0.004 0.089
0.019 0.013 0.014 0.009
0.419 0.043 0.055 0.394 0.016
0.035 0.004 0.016
8 o 0
o
Note 1. Plastic or metal protrusions of 0.15 mm (0.006 inch) maximum per side are not included. OUTLINE VERSION SOT163-1 REFERENCES IEC 075E04 JEDEC MS-013 JEITA EUROPEAN PROJECTION
ISSUE DATE 99-12-27 03-02-19
Fig 46. Package outline SOT163-1 (SO20)
PCA9665_2 (c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
80 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
TSSOP20: plastic thin shrink small outline package; 20 leads; body width 4.4 mm
SOT360-1
D
E
A
X
c y HE vMA
Z
20
11
Q A2 pin 1 index A1 (A 3) A
Lp L
1
e bp
10
wM detail X
0
2.5 scale
5 mm
DIMENSIONS (mm are the original dimensions) UNIT mm A max. 1.1 A1 0.15 0.05 A2 0.95 0.80 A3 0.25 bp 0.30 0.19 c 0.2 0.1 D (1) 6.6 6.4 E (2) 4.5 4.3 e 0.65 HE 6.6 6.2 L 1 Lp 0.75 0.50 Q 0.4 0.3 v 0.2 w 0.13 y 0.1 Z (1) 0.5 0.2 8 o 0
o
Notes 1. Plastic or metal protrusions of 0.15 mm maximum per side are not included. 2. Plastic interlead protrusions of 0.25 mm maximum per side are not included. OUTLINE VERSION SOT360-1 REFERENCES IEC JEDEC MO-153 JEITA EUROPEAN PROJECTION ISSUE DATE 99-12-27 03-02-19
Fig 47. Package outline SOT360-1 (TSSOP20)
PCA9665_2 (c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
81 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
HVQFN20: plastic thermal enhanced very thin quad flat package; no leads; 20 terminals; body 5 x 5 x 0.85 mm
SOT662-1
D
B
A
terminal 1 index area E
A A1 c
detail X
e1 e 6 L 11 b 10 vMCAB wMC y1 C
C y
5
e Eh e2
1
15
terminal 1 index area
20 Dh 0
16
X
2.5 scale
5 mm
DIMENSIONS (mm are the original dimensions) UNIT mm A(1) max. 1 A1 0.05 0.00 b 0.38 0.23 c 0.2 D(1) 5.1 4.9 Dh 3.25 2.95 E(1) 5.1 4.9 Eh 3.25 2.95 e 0.65 e1 2.6 e2 2.6 L 0.75 0.50 v 0.1 w 0.05 y 0.05 y1 0.1
Note 1. Plastic or metal protrusions of 0.075 mm maximum per side are not included. OUTLINE VERSION SOT662-1 REFERENCES IEC --JEDEC MO-220 JEITA --EUROPEAN PROJECTION ISSUE DATE 01-08-08 02-10-22
Fig 48. Package outline SOT662-1 (HVQFN20)
PCA9665_2 (c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
82 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
16. Handling information
Inputs and outputs are protected against electrostatic discharge in normal handling. However, to be completely safe you must take normal precautions appropriate to handling integrated circuits.
17. Soldering
17.1 Introduction
There is no soldering method that is ideal for all surface mount IC packages. Wave soldering can still be used for certain surface mount ICs, but it is not suitable for fine pitch SMDs. In these situations reflow soldering is recommended.
17.2 Through-hole mount packages
17.2.1 Soldering by dipping or by solder wave
Typical dwell time of the leads in the wave ranges from 3 seconds to 4 seconds at 250 C or 265 C, depending on solder material applied, SnPb or Pb-free respectively. The total contact time of successive solder waves must not exceed 5 seconds. The device may be mounted up to the seating plane, but the temperature of the plastic body must not exceed the specified maximum storage temperature (Tstg(max)). If the printed-circuit board has been pre-heated, forced cooling may be necessary immediately after soldering to keep the temperature within the permissible limit.
17.2.2 Manual soldering
Apply the soldering iron (24 V or less) to the lead(s) of the package, either below the seating plane or not more than 2 mm above it. If the temperature of the soldering iron bit is less than 300 C it may remain in contact for up to 10 seconds. If the bit temperature is between 300 C and 400 C, contact may be up to 5 seconds.
17.3 Surface mount packages
17.3.1 Reflow soldering
Key characteristics in reflow soldering are:
* Lead-free versus SnPb soldering; note that a lead-free reflow process usually leads to
higher minimum peak temperatures (see Figure 49) than a PbSn process, thus reducing the process window
* Solder paste printing issues including smearing, release, and adjusting the process
window for a mix of large and small components on one board
* Reflow temperature profile; this profile includes preheat, reflow (in which the board is
heated to the peak temperature) and cooling down. It is imperative that the peak temperature is high enough for the solder to make reliable solder joints (a solder paste characteristic). In addition, the peak temperature must be low enough that the
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
83 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
packages and/or boards are not damaged. The peak temperature of the package depends on package thickness and volume and is classified in accordance with Table 54 and 55
Table 54. SnPb eutectic process (from J-STD-020C) Package reflow temperature (C) Volume (mm3) < 350 < 2.5 2.5 Table 55. 235 220 Lead-free process (from J-STD-020C) Package reflow temperature (C) Volume (mm3) < 350 < 1.6 1.6 to 2.5 > 2.5 260 260 250 350 to 2000 260 250 245 > 2000 260 245 245 350 220 220
Package thickness (mm)
Package thickness (mm)
Moisture sensitivity precautions, as indicated on the packing, must be respected at all times. Studies have shown that small packages reach higher temperatures during reflow soldering, see Figure 49.
temperature
maximum peak temperature = MSL limit, damage level
minimum peak temperature = minimum soldering temperature
peak temperature
time
001aac844
MSL: Moisture Sensitivity Level
Fig 49. Temperature profiles for large and small components
For further information on temperature profiles, refer to Application Note AN10365 "Surface mount reflow soldering description".
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
84 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
17.3.2 Wave soldering
Conventional single wave soldering is not recommended for surface mount devices (SMDs) or printed-circuit boards with a high component density, as solder bridging and non-wetting can present major problems. To overcome these problems the double-wave soldering method was specifically developed. If wave soldering is used the following conditions must be observed for optimal results:
* Use a double-wave soldering method comprising a turbulent wave with high upward
pressure followed by a smooth laminar wave.
* For packages with leads on two sides and a pitch (e):
- larger than or equal to 1.27 mm, the footprint longitudinal axis is preferred to be parallel to the transport direction of the printed-circuit board; - smaller than 1.27 mm, the footprint longitudinal axis must be parallel to the transport direction of the printed-circuit board. The footprint must incorporate solder thieves at the downstream end.
* For packages with leads on four sides, the footprint must be placed at a 45 angle to
the transport direction of the printed-circuit board. The footprint must incorporate solder thieves downstream and at the side corners. During placement and before soldering, the package must be fixed with a droplet of adhesive. The adhesive can be applied by screen printing, pin transfer or syringe dispensing. The package can be soldered after the adhesive is cured. Typical dwell time of the leads in the wave ranges from 3 seconds to 4 seconds at 250 C or 265 C, depending on solder material applied, SnPb or Pb-free respectively. A mildly-activated flux will eliminate the need for removal of corrosive residues in most applications.
17.3.3 Manual soldering
Fix the component by first soldering two diagonally-opposite end leads. Use a low voltage (24 V or less) soldering iron applied to the flat part of the lead. Contact time must be limited to 10 seconds at up to 300 C. When using a dedicated tool, all other leads can be soldered in one operation within 2 seconds to 5 seconds between 270 C and 320 C.
17.4 Package related soldering information
Table 56. Mounting Through-hole mount Through-hole-surface mount Suitability of IC packages for wave, reflow and dipping soldering methods Package[1] CPGA, HCPGA DBS, DIP, HDIP, RDBS, SDIP, SIL PMFP[4] Soldering method Wave suitable suitable[3] not suitable Reflow[2] - - not suitable Dipping - suitable -
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
85 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Table 56. Mounting
Suitability of IC packages for wave, reflow and dipping soldering methods ...continued Package[1] HTSSON..T[5], Soldering method Wave Reflow[2] suitable Dipping -
Surface mount
not suitable BGA, LBGA, LFBGA, SQFP, SSOP..T[5], TFBGA, VFBGA, XSON DHVQFN, HBCC, HBGA, HLQFP, HSO, HSOP, HSQFP, HSSON, HTQFP, HTSSOP, HVQFN, HVSON, SMS PLCC[7], SO, SOJ LQFP, QFP, TQFP SSOP, TSSOP, VSO, VSSOP CWQCCN..L[10], WQCCN..L[10] not suitable[6]
suitable
-
suitable not not recommended[7][8] recommended[9]
suitable suitable suitable not suitable
- - - -
not suitable
[1] [2]
For more detailed information on the BGA packages refer to the (LF)BGA Application Note (AN01026); order a copy from your NXP Semiconductors sales office. All surface mount (SMD) packages are moisture sensitive. Depending upon the moisture content, the maximum temperature (with respect to time) and body size of the package, there is a risk that internal or external package cracks may occur due to vaporization of the moisture in them (the so called popcorn effect). For SDIP packages, the longitudinal axis must be parallel to the transport direction of the printed-circuit board. Hot bar soldering or manual soldering is suitable for PMFP packages. These transparent plastic packages are extremely sensitive to reflow soldering conditions and must on no account be processed through more than one soldering cycle or subjected to infrared reflow soldering with peak temperature exceeding 217 C 10 C measured in the atmosphere of the reflow oven. The package body peak temperature must be kept as low as possible. These packages are not suitable for wave soldering. On versions with the heatsink on the bottom side, the solder cannot penetrate between the printed-circuit board and the heatsink. On versions with the heatsink on the top side, the solder might be deposited on the heatsink surface. If wave soldering is considered, then the package must be placed at a 45 angle to the solder wave direction. The package footprint must incorporate solder thieves downstream and at the side corners. Wave soldering is suitable for LQFP, QFP and TQFP packages with a pitch (e) larger than 0.8 mm; it is definitely not suitable for packages with a pitch (e) equal to or smaller than 0.65 mm. Wave soldering is suitable for SSOP, TSSOP, VSO and VSSOP packages with a pitch (e) equal to or larger than 0.65 mm; it is definitely not suitable for packages with a pitch (e) equal to or smaller than 0.5 mm.
[3] [4] [5]
[6]
[7] [8] [9]
[10] Image sensor packages in principle should not be soldered. They are mounted in sockets or delivered pre-mounted on flex foil. However, the image sensor package can be mounted by the client on a flex foil by using a hot bar soldering process. The appropriate soldering profile can be provided on request.
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
86 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
18. Abbreviations
Table 57. Acronym ASIC CDM CPU DSP ESD HBM I2C-bus I/O MM PCB SMBus Abbreviations Description Application Specific Integrated Circuit Charged Device Model Central Processing Unit Digital Signal Processing ElectroStatic Discharge Human Body Model Inter-Integrated Circuit bus Input/Output Machine Model Printed-Circuit Board System Management Bus
19. Revision history
Table 58. Revision history Release date 20061207 Data sheet status Product data sheet Change notice Supersedes PCA9665_1 Document ID PCA9665_2 Modifications:
* * * * * *
The format of this data sheet has been redesigned to comply with the new identity guidelines of NXP Semiconductors. Legal texts have been adapted to the new company name where appropriate. Descriptive title changed from "Fast-mode Plus parallel bus to I2C-bus controller" to "Fm+ parallel bus to I2C-bus controller" Table 12 "I2CCON - Control register (A1 = 1, A0 = 1) bit description", description of bit 6, 4th paragraph: changed "... it takes 550 s for the internal oscillator to start up, ..." to "... it takes 550 s enable time for the internal oscillator to start up, and the serial interface to initialize." Table 25 "I2C-bus mode selection example[1]", Table note 2: equation denominator close parenthesis position revised Table 48 "Static characteristics": - sub-section "Supply": unit for IDD standby mode changed from "A" to "mA" - sub-section "Supply": IDD, operating mode: changed Max value from 6.0 mA to 8.0 mA - sub-section "Inputs WR, RD, A0, A1, CE, RESET", Ci (Typ) changed from 1.7 pF to 2.0 pF - sub-section "Inputs/outputs D0 to D7", Cio (Typ) changed from 2.4 pF to 2.8 pF - sub-section "SDA and SCL", Cio: (Typ) changed from 2.5 pF to 5.6 pF; (Max) changed from 4 pF to 7 pF - sub-section "Outputs INT", Co: (Typ) changed from 2.1 pF to 3.8 pF; (Max) changed from 4 pF to 5 pF
*
Table 49 "Dynamic characteristics (3.3 volt)[1][2][3]": - sub-section "Power-on reset timing" changed to "Initialization timing" - "tPOR, power-on reset pulse time" changed to "tinit(po), power-on initialization time" - added sub-section "Serial interface initialization timing" and (new) Table note 4 - added sub-section "INT timing"
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
87 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
Table 58.
Revision history ...continued Release date Data sheet status Change notice Supersedes
Document ID Modifications: (continued)
*
Table 49, sub-section "Bus timing": - changed Min value for th(A) from 7 ns to 13 ns - changed Min value for tw(RDL) from 7 ns to 20 ns - changed Min value for tw(WRL) from 7 ns to 20 ns - changed Min value for tsu(Q) from 7 ns to 12 ns - changed Min value for tw(RDH) from 12 ns to 18 ns - changed Min value for tw(WRH) from 12 ns to 18 ns
*
Table 50 "Dynamic characteristics (2.5 volt)[1][2][3]": - added sub-sections "Initialization timing" and "Serial interface initialization timing" - sub-section "INT timing": changed tas(int) from (Typ) "" to (Max) "550 ns" - sub-section "INT timing": changed tdas(int) from (Typ) "" to (Max) "20 ns"
*
Table 50, sub-section "Bus timing": - changed Min value for th(A) from 9 ns to 13 ns - changed Min value for tw(RDL) from 9 ns to 20 ns - changed Min value for tw(WRL) from 9 ns to 20 ns - changed Min value for tsu(Q) from 8 ns to 12 ns - changed Min value for tw(RDH) from 12 ns to 18 ns - changed Min value for tw(WRH) from 12 ns to 18 ns
* * * *
Figure 36 "Reset timing" modified Figure 38 "Bus timing (read cycle)" modified Added (new) Figure 39 "Parallel bus timing (write cycle)" Table 51 "I2C-bus frequency and timing specifications": - tVD;ACK (Min) changed: (Standard-mode) from 0.3 s to 0.05 s; (Fast-mode) from 0.1 s to 0.05 s - tVD;DAT (Min) changed: (Fast-mode Plus) from "" to "50 ns" - tSP (Max) changed: (Fast-mode Plus) from "" to "50 ns"
* * * *
PCA9665_1
Added (new) Figure 42 "I2C-bus timing diagram" Figure 43 "Test circuitry for switching times" modified (at switch, "6.0 V" changed to "VDD x 2" Table 52: modified test td(DV) changed S1 value from "6 V" to "VDD x 2" Added (new) Figure 44 "Test circuitry for open-drain switching times" and Table 53. Objective data sheet -
20060807
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
88 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
20. Legal information
20.1 Data sheet status
Document status[1][2] Objective [short] data sheet Preliminary [short] data sheet Product [short] data sheet
[1] [2] [3]
Product status[3] Development Qualification Production
Definition This document contains data from the objective specification for product development. This document contains data from the preliminary specification. This document contains the product specification.
Please consult the most recently issued document before initiating or completing a design. The term `short data sheet' is explained in section "Definitions". The product status of device(s) described in this document may have changed since this document was published and may differ in case of multiple devices. The latest product status information is available on the Internet at URL http://www.nxp.com.
20.2 Definitions
Draft -- The document is a draft version only. The content is still under internal review and subject to formal approval, which may result in modifications or additions. NXP Semiconductors does not give any representations or warranties as to the accuracy or completeness of information included herein and shall have no liability for the consequences of use of such information. Short data sheet -- A short data sheet is an extract from a full data sheet with the same product type number(s) and title. A short data sheet is intended for quick reference only and should not be relied upon to contain detailed and full information. For detailed and full information see the relevant full data sheet, which is available on request via the local NXP Semiconductors sales office. In case of any inconsistency or conflict with the short data sheet, the full data sheet shall prevail.
result in personal injury, death or severe property or environmental damage. NXP Semiconductors accepts no liability for inclusion and/or use of NXP Semiconductors products in such equipment or applications and therefore such inclusion and/or use is at the customer's own risk. Applications -- Applications that are described herein for any of these products are for illustrative purposes only. NXP Semiconductors makes no representation or warranty that such applications will be suitable for the specified use without further testing or modification. Limiting values -- Stress above one or more limiting values (as defined in the Absolute Maximum Ratings System of IEC 60134) may cause permanent damage to the device. Limiting values are stress ratings only and operation of the device at these or any other conditions above those given in the Characteristics sections of this document is not implied. Exposure to limiting values for extended periods may affect device reliability. Terms and conditions of sale -- NXP Semiconductors products are sold subject to the general terms and conditions of commercial sale, as published at http://www.nxp.com/profile/terms, including those pertaining to warranty, intellectual property rights infringement and limitation of liability, unless explicitly otherwise agreed to in writing by NXP Semiconductors. In case of any inconsistency or conflict between information in this document and such terms and conditions, the latter will prevail. No offer to sell or license -- Nothing in this document may be interpreted or construed as an offer to sell products that is open for acceptance or the grant, conveyance or implication of any license under any copyrights, patents or other industrial or intellectual property rights.
20.3 Disclaimers
General -- Information in this document is believed to be accurate and reliable. However, NXP Semiconductors does not give any representations or warranties, expressed or implied, as to the accuracy or completeness of such information and shall have no liability for the consequences of use of such information. Right to make changes -- NXP Semiconductors reserves the right to make changes to information published in this document, including without limitation specifications and product descriptions, at any time and without notice. This document supersedes and replaces all information supplied prior to the publication hereof. Suitability for use -- NXP Semiconductors products are not designed, authorized or warranted to be suitable for use in medical, military, aircraft, space or life support equipment, nor in applications where failure or malfunction of a NXP Semiconductors product can reasonably be expected to
20.4 Trademarks
Notice: All referenced brands, product names, service names and trademarks are the property of their respective owners. I2C-bus -- logo is a trademark of NXP B.V.
21. Contact information
For additional information, please visit: http://www.nxp.com For sales office addresses, send an email to: salesaddresses@nxp.com
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
89 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
22. Contents
1 2 3 4 5 6 6.1 6.2 7 7.1 7.2 7.3 7.3.1 7.3.1.1 7.3.1.2 7.3.1.3 7.3.1.4 7.3.1.5 7.3.2 7.3.2.1 7.3.2.2 7.3.2.3 7.3.2.4 7.3.2.5 7.3.2.6 8 8.1 8.1.1 8.1.2 8.2 8.3 8.3.1 8.3.2 8.3.3 8.3.4 8.4 8.4.1 General description . . . . . . . . . . . . . . . . . . . . . . 1 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Ordering information . . . . . . . . . . . . . . . . . . . . . 2 Block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Pinning information . . . . . . . . . . . . . . . . . . . . . . 4 Pinning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Pin description . . . . . . . . . . . . . . . . . . . . . . . . . 5 Functional description . . . . . . . . . . . . . . . . . . . 6 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Internal oscillator . . . . . . . . . . . . . . . . . . . . . . . 6 Registers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 Direct registers . . . . . . . . . . . . . . . . . . . . . . . . . 8 The Status register, I2CSTA (A1 = 0, A0 = 0) . . 8 The Indirect Pointer register, INDPTR (A1 = 0, A0 = 0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 The I2C-bus Data register, I2CDAT (A1 = 0, A0 = 1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 The Control register, I2CCON (A1 = 1, A0 = 1) 9 The indirect data field access register, INDIRECT (A1 = 1, A0 = 0) . . . . . . . . . . . . . . 11 Indirect registers . . . . . . . . . . . . . . . . . . . . . . . 12 The Byte Count register, I2CCOUNT (indirect address 00h). . . . . . . . . . . . . . . . . . . . . . . . . . 12 The Own Address register, I2CADR (indirect address 01h). . . . . . . . . . . . . . . . . . . . . . . . . . 12 The Clock Rate registers, I2CSCLL and I2CSCLH (indirect addresses 02h and 03h) . . 13 The Time-out register, I2CTO (indirect address 04h). . . . . . . . . . . . . . . . . . . . . . . . . . 14 The Parallel Software Reset register, I2CPRESET (indirect address 05h) . . . . . . . . 14 The I2C-bus mode register, I2CMODE (indirect address 06h) . . . . . . . . . . . . . . . . . . . 15 PCA9665 modes. . . . . . . . . . . . . . . . . . . . . . . . 16 Configuration modes. . . . . . . . . . . . . . . . . . . . 16 Byte mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 Buffered mode . . . . . . . . . . . . . . . . . . . . . . . . 16 Operating modes . . . . . . . . . . . . . . . . . . . . . . 16 Byte mode. . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 Master Transmitter Byte mode . . . . . . . . . . . . 17 Master Receiver Byte mode . . . . . . . . . . . . . . 22 Slave Receiver Byte mode . . . . . . . . . . . . . . . 25 Slave Transmitter Byte mode . . . . . . . . . . . . . 29 Buffered mode . . . . . . . . . . . . . . . . . . . . . . . . 31 Master Transmitter Buffered mode . . . . . . . . . 31 8.4.2 8.4.3 8.4.4 8.5 8.5.1 8.5.2 8.5.3 8.5.4 8.5.5 Master Receiver Buffered mode. . . . . . . . . . . Slave Receiver Buffered mode. . . . . . . . . . . . Slave Transmitter Buffered mode . . . . . . . . . . Buffered mode examples . . . . . . . . . . . . . . . . Buffered Master Transmitter mode of operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . Buffered Master Receiver mode of operation. Buffered Slave Transmitter mode . . . . . . . . . . Buffered Slave Receiver mode. . . . . . . . . . . . Example: Read 128 bytes in two 64-byte sequences of an EEPROM (I2C-bus address = A0h for write operations and A1h for read operations) starting at Location 08h. . . . . . . . . . . . . . . . . . . . . . . . . . I2CCOUNT register . . . . . . . . . . . . . . . . . . . . Acknowledge management (I2C-busaddresses and data) in Byte and Buffered modes . . . . . . . . . . . . . . . . . . . . . . . Miscellaneous states . . . . . . . . . . . . . . . . . . . I2CSTA = F8h. . . . . . . . . . . . . . . . . . . . . . . . . I2CSTA = 00h . . . . . . . . . . . . . . . . . . . . . . . . . I2CSTA = 70h . . . . . . . . . . . . . . . . . . . . . . . . . I2CSTA = 78h . . . . . . . . . . . . . . . . . . . . . . . . . Some special cases . . . . . . . . . . . . . . . . . . . . Simultaneous repeated START conditions from two masters . . . . . . . . . . . . . . . . . . . . . . Data transfer after loss of arbitration . . . . . . . Forced access to the I2C-bus . . . . . . . . . . . . . I2C-bus obstructed by a LOW level on SCL or SDA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Bus error . . . . . . . . . . . . . . . . . . . . . . . . . . . . Power-on reset . . . . . . . . . . . . . . . . . . . . . . . . Reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I2C-bus timing diagrams, Unbuffered mode . . I2C-bus timing diagrams, Buffered mode . . . . Characteristics of the I2C-bus . . . . . . . . . . . . Bit transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . START and STOP conditions . . . . . . . . . . . . . System configuration . . . . . . . . . . . . . . . . . . . Acknowledge . . . . . . . . . . . . . . . . . . . . . . . . . Application design-in information . . . . . . . . . Specific applications. . . . . . . . . . . . . . . . . . . . Add I2C-bus port . . . . . . . . . . . . . . . . . . . . . . Add additional I2C-bus ports . . . . . . . . . . . . . Convert 8 bits of parallel data into I2C-bus serial data stream . . . . . . . . . . . . . . . Limiting values . . . . . . . . . . . . . . . . . . . . . . . . 36 40 45 48 48 48 49 50
8.6 8.7
50 51
8.8 8.8.1 8.8.2 8.8.3 8.8.4 8.9 8.9.1 8.9.2 8.9.3 8.9.4 8.9.5 8.10 8.11 8.12 8.13 9 9.1 9.1.1 9.2 9.3 10 10.1 10.2 10.3 10.4 11
53 57 57 57 57 58 58 58 58 58 59 60 60 61 61 63 65 65 65 65 66 67 67 67 68 68 69
continued >>
PCA9665_2
(c) NXP B.V. 2006. All rights reserved.
Product data sheet
Rev. 02 -- 7 December 2006
90 of 91
NXP Semiconductors
PCA9665
Fm+ parallel bus to I2C-bus controller
70 71 78 79 83 83 83 83 83 83 83 83 85 85 85 87 87 89 89 89 89 89 89 90
12 13 14 15 16 17 17.1 17.2 17.2.1 17.2.2 17.3 17.3.1 17.3.2 17.3.3 17.4 18 19 20 20.1 20.2 20.3 20.4 21 22
Static characteristics. . . . . . . . . . . . . . . . . . . . Dynamic characteristics . . . . . . . . . . . . . . . . . Test information . . . . . . . . . . . . . . . . . . . . . . . . Package outline . . . . . . . . . . . . . . . . . . . . . . . . Handling information. . . . . . . . . . . . . . . . . . . . Soldering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . Through-hole mount packages . . . . . . . . . . . . Soldering by dipping or by solder wave . . . . . Manual soldering . . . . . . . . . . . . . . . . . . . . . . Surface mount packages . . . . . . . . . . . . . . . . Reflow soldering . . . . . . . . . . . . . . . . . . . . . . . Wave soldering . . . . . . . . . . . . . . . . . . . . . . . . Manual soldering . . . . . . . . . . . . . . . . . . . . . . Package related soldering information . . . . . . Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . Revision history . . . . . . . . . . . . . . . . . . . . . . . . Legal information. . . . . . . . . . . . . . . . . . . . . . . Data sheet status . . . . . . . . . . . . . . . . . . . . . . Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . Disclaimers . . . . . . . . . . . . . . . . . . . . . . . . . . . Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . Contact information. . . . . . . . . . . . . . . . . . . . . Contents . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Please be aware that important notices concerning this document and the product(s) described herein, have been included in section `Legal information'.
(c) NXP B.V. 2006.
All rights reserved.
For more information, please visit: http://www.nxp.com For sales office addresses, please send an email to: salesaddresses@nxp.com Date of release: 7 December 2006 Document identifier: PCA9665_2


▲Up To Search▲   

 
Price & Availability of PCA9665

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X